Test SolAR

We provide you a bundle to test our samples code. It is .zip file including SolAR’s .apk and markers if required.

Table 1. Available Samples

SolAR Demo (Fiducial, Natural, SLAM)

download link

Print the marker included in .zip file to use it during the test.

Install development environment

Install Qt Creator IDE

The SolAR framework uses a dedicated pipeline to link and compile code as well as internal tools for third party downloads which should make your job much easier. As you will see later, the SolAR framework is based on QMake originally created by the Qt Company, but compliant with most IDE.

Refer to your OS section to install your development environment, whether on Windows or Linux.

Do not forget to install Qt Android component. SolAR supports arm64-v8a architecture only.
It is recommended to install IDE for your own OS to test directly your pipeline on your system and then compile it for Android

Install Android SDK and NDK

Once Qt Creator installed we can install dependencies required by Qt Creator for Android :

We recommend you to install this dependencies using Unity Android build support module (available from Unity HUB, see build support)
Otherwise you can also directly download the dependencies in Qt Creator from SDKManager in Android tab of Tools>Options>Devices

You can find more information in Qt documentation : Android building

Configure Qt Android Kit

In Qt Creator navigation bar go to Tools > Options > Devices. Then fill required path and check if your Android kit is valid :

Android kit configuration
Figure 1. Android kit configuration

Install SolAR dependencies

Refer to your OS section to install Remaken, whether on Windows or Linux.

Set Remaken for Android

You need to configure your Remaken profile according to your development environment. To do so, run the following command in a command prompt:

remaken profile init --cpp-std 17 -b clang -o android -a arm64-v8a

You can check if the change have been done in your Remaken profile using :

remaken profile display

Set Conan profile for Android

As we are using Conan to download dependencies, you need to configure your default conan profile. To do so, open the default file available in your ${HOME}/.conan/profiles, and replace the configuration by the following one before saving it:

[settings]
os=Android
os_build=Linux
arch=armv8
arch_build=x86_64
compiler=clang
compiler.version=8
compiler.libcxx=libc++
build_type=Release
os.api_level=21
compiler.cppstd=17
[options]
[build_requires]
[env]
os_build should match your OS (Windows or Linux)

Now, you are ready to download your dependencies with Remaken.

Use Remaken

Remaken uses a file called packagedependencies.txt to describe which depedencies to install, in which version, where to install them, where to download them, with which package manager and with which configuration.

A global packagedepedencies.txt defining the common dependencies with specific packagedependencies_os.txt files defining dependencies which are specific for each os are available in the parent GIT repository SolAR, and can be downloaded on the following link:

Copy these files where you want on your computer, open a command prompt in the folder where you have copied the packagedependencies.txt and packagedependencies_os.txt files, and run remaken with the following command:

remaken install packagedependencies.txt

This command will install all SolAR dependencies in release mode.

To download the dependencies in debug mode, run the following command:

remaken install -c debug packagedependencies.txt

This is done, all your dependencies are downloaded and ready to use ! Some of the module will download and build third parties using Conan which requires CMake (minimum version 3.10).

Build SolAR

Clone SolAR

SolAR is made up of a multitude of projects (SolAR Framework, SolAR pipeline manager, modules, samples, etc.). To help you, we have created a parent repository with sub-modules regrouping all source codes of SolAR projects. You can clone it from the following url: https://github.com/SolarFramework/SolAR.git

No space in the path of the folder where you are cloning SolAR !
git clone https://github.com/SolarFramework/SolAR.git

Do not forget to install and update recursively the submodules:

cd SolAR
git submodule update --init --recursive

If you want to move all submodules on Master, launch the following command

git submodule foreach git pull origin master

If you do not want to download all the source codes of SolAR, you can have a look to the different repositories available on Github on the Community/Git page.

Build on Qt Creator

Open the Qt project of your choice, for instance a sample. Check by clicking on the Projects tab, and then on the Manage Kits…​ button that your Qt x.x.x Android for arm64-v8a kit is well configured

In your project build settings of your kit, for each configuration (release and debug) :
- Add argument install to the Builds Steps > Make step of your kit to copy built module output and its dependencies in ${HOME}/.remaken/packages
- Disable step Make install and Build Android APK
Edit build settings
Figure 2. Edit build settings

Just run qmake, and build your project to generate a .so.
Now your dynamically linked shared object library can be use as a SolAR module in Unity to build an Android application.

Unity SolAR Android

To build a SolAR Android application you need to have Android build support module installed.

Add Android build support module from Unity HUB
Figure 3. Add Android build support module from Unity HUB

Set your Unity Android environment. Then you need to set your current target platform of Unity Editor File > Build settings to Android. In the player settings you must specify a package name (ex : com.company.appname) and set the configuration to support SolAR Framework.

SolAR modules provide support for AArch64 instruction sets through Application Binary Interface arm64-v8a. This is the most common architecture used by Android devices.
Set player settings for arm64-v8a and SolAR
Figure 4. Set player settings for arm64-v8a and SolAR

Now you can import your SolAR modules and their dependencies in your Unity project in the dedicated directory ./Assets/Plugins/Android/.

  • If you haven’t build or download modules and dependencies for Android, execute ./plugin/unity/SolARUnityPlugin/Install.bat.

  • Otherwise you could simply execute ./plugin/unity/SolARUnityPlugin/Bundle.bat to bundle .so of your Remaken packages and wrap SWIG.

You cannot directly test your pipeline in Unity Editor with modules built for Android. It is recommended to develop for your OS in a first time and then provide your module for Android.

Congratulation, your configuration is ready to use and you can build your .apk with Unity to play it on your Android device. If necessary you can set Unity build settings options and use ADB to debug your app.

Moreover you can edit your pipeline configuration on your device. XML is stored in your public path of the application in your internal memory (ie : /storage/emulated/0/Android/data/com.company.appname/files/StreamingAssets/SolAR/Pipelines/*.xml)

You can find more information for SolAR Android Unity pipeline in Unity Android Deployment