[Interest] How to use QtPositioning on Android

Blasche Alexander Alexander.Blasche at digia.com
Fri Aug 15 11:25:18 CEST 2014

Hi Martin,

You are moving outside of the supported deployment environment. 
Since my domain is positioning only and not the deployment of Qt on Android I can only provide some hints.

The values are not documented since they are private implementation detail. The only way to figure this out is to become familiar with the androiddeployqt tool I guess. What might help is to use the normal qmake/androiddeployqt  setup for a test app, go into test apps Creator project settings, select your your Android kit and activate the "Verbose output" checkbox in the Run section. This dumps the commands related to the deployment process into the "Compile Output" tab.

More below...

> -----Original Message-----
> From: interest-bounces+alexander.blasche=digia.com at qt-project.org
> [mailto:interest-bounces+alexander.blasche=digia.com at qt-project.org] On
> Behalf Of Martin Koller

> As the large app does neither use qtcreator nor qmake (we use cmake),
> can someone tell me what I need to configure (AndroidManifest.xml or any
> other .xml file) so that my app shows
> the available "android" positions plugin ?
> Note that I want to use Ministro.
> I see in the test app's AndroidManifest.xml file the following lines, however
> I can not find any documentation about what these lines are good for
> (especially the ones mentioning QtSensors.jar and QtPositioning.jar).
> What do they do and how do I need to use them.
>             <meta-data android:name="android.app.use_local_qt_libs"
> android:value="0"/>
>             <meta-data android:name="android.app.libs_prefix"
> android:value="/data/local/tmp/qt/"/>
>             <meta-data android:name="android.app.load_local_libs"
> android:value="plugins/platforms/android/libqtforandroid.so:plugins/sensors/lib
> qtsensors_android.so:plugins/position/libqtposition_android.so"/>

Libqtposition_android.so is the position plugin for android. It must be loaded by the application.

>             <meta-data android:name="android.app.load_local_jars"
> android:value="jar/QtAndroid.jar:jar/QtAndroidAccessibility.jar:jar/QtAndroid-
> bundled.jar:jar/QtAndroidAccessibility-
> bundled.jar:jar/QtSensors.jar:jar/QtSensors-
> bundled.jar:jar/QtPositioning.jar:jar/QtPositioning-bundled.jar"/>

AFAICT the QtPositioning-bundled.jar contains the Java classes which are part of the QtPositioning  port for Android.

>             <meta-data android:name="android.app.static_init_classes"
> android:value="org.qtproject.qt5.android.sensors.QtSensors:org.qtproject.qt5.a
> ndroid.sensors.QtSensors:org.qtproject.qt5.android.positioning.QtPositioning:or
> g.qtproject.qt5.android.positioning.QtPositioning"/>

QtPositioning is the name of Java class which is the main entry point for the position plugin.

> It's also not clear if these lines are used at all when using Ministro.
> Thanks.

Another reason why you might not see the plugin could be the fact that you don't deploy all the required Qt libs/jar/files to the device or potentially into the wrong location.


More information about the Interest mailing list