Developing for Android

Introduction

This page is describes development for deployment to Android devices. There is quite a lot of detail here, possibly too much.

Android support in Trimble Access versions

Getting set up

We highly recommend installing and getting a simple plugin working with Windows before attempting an Android version.

See this page for setting up the toolchain for Android. This is mostly about installing the Android SDK and NDK.

Summary of differences with Android (as opposed to Windows)

Scapi is fully supported for Android devices. Some Windows features (such as embedded resources) are not used so that the two platforms are consistent.

Note that earlier plugins (v19.00 to v20.01) remain binary compatible with Trimble Access Windows v20.01 and beyond, and that developers may continue to use the v19.00 SDK to create plugins to run with those versions of TA. Source-code compatibility does not extend to graphic drawing methods; plugins which use the Windows GDI++ to draw their own graphics must be updated to use the 20.10 SDK instead.  

Creating an Android plugin project using MS Visual Studio

On the development machine, the Android SDK and NDK must be installed, and in rare cases Qt may be required for the build. Development is still with MS Visual Studio 2019 or 2022. See the version table on the Home page for which MSVS version to install.

The guide to installing the required Android build tools can be found here.

A new Android project is created using the New project wizard supplied in the SDK, and the files from the existing Windows project added to it - another project using the same files does not copy the files, so almost all of the project's files are common to and shared between both platforms.

As far as possible, development for the two platforms has been kept in step so that, in general, any changes made to a Windows plugin will simply work for Android, and vice-versa.

The many steps below might look daunting. It's not that bad, we've just included a lot of detail.

Update: There are several references to sharing files between the Windows and Android projects. Those were made in relation to a Windows project created using a Windows project template from v21.10 or later. Windows projects older than v21.10 will be different and upgrading them to the latest template would be worthwhile, before starting work on an Android version.

Build (mostly about updating Windows plugins to compile for Android)

Resources and installation directories:

Installation : Deploying a plugin to Android

Installation is now covered on this page.

Resources

Example of code (in bold) to be added to existing tsc_InitializePlugin function (use the same code for both Windows and Android):

extern void tsc_InitializePlugin ()

{

    tsc_SurveyCore::RegisterApplication (...);  

    tsc_SurveyCore::RegisterUITask (...);

    ...

 

    tsc_SurveyCore::RegisterAssets (

    {

        {IDB_FolderIcon,  "FolderPic.png"}, 

        {IDB_Pencil,      "Pencil.png"},

        {...},

        {IDF_TemplateXml, "CustomDataTemplate.xml"} 

    });

}

Using QImage & QPainter

Before using Qt to draw your graphics or any other part of it's large repertoire, carefully consider how you will obtain the Qt build tools and get an appropriate license for your use of it.

Take a look at the tsc_Image page, instructions can be found there regarding use of Qt methods.