Version 29 (modified by 9 years ago) (diff) | ,
---|
PyOtherSide for Android
This article describes current progress towards being able to run applications using Python 3 & QtQuick 2.0 using the PyOtherSide Python <-> QtQuick bindings.
Current Status
- Qt 5 & QtQuick 2.0 - available & working
- Python 3 (3.2) - available & working
- PyOtherSide - WiP
- compilation - working
- basic deployment - working
- using PyOtherSide without crashing - working
- standalone APK package - working
For more details see:
https://github.com/M4rtinK/pyotherside/blob/master/docs/index.rst
Notes from the PyOtherSide for Android development phase have been archived here.
Packaging
Building the Android package from CLI
For build script integration it would be nice to be able to non-interactively build a Python application package for Android, without the need to do that manually in the QtCreator GUI.
Fortunately the ''androiddeployqt'' tool seems to do just that. :)
Using androiddeployqt
The androiddeployqt makes it possible to create android packages (APK) for Qt applications from the command line.
But before you can start using it, you need to export paths to your Android NDK & SDK as environmental variables so that the tools can find them:
export ANDROID_NDK_ROOT=<path to Android NDK top level folder> export ANDROID_SDK_ROOT=<path to Android SDK top level folder>
Note that the NDK should preferably be the same one that has been used for your Python 3 for Android build.
Next you need to run qmake & make in your project directory to prepare it for androiddeployqt.
Note that you should use the qmake that from your Qt for Android SDK, not the system-wide qmake, so that any platform dependent code (C++ launcher, etc.) in your project is correctly compiled for Android. For example for the Qt 5.3 Android SDK on Linux installed in /opt this "android qmake" is in /opt/Qt5.3/5.3/android_armv7/bin/qmake
.
qmake make install INSTALL_ROOT=android-build/
Next run the tool to create an APK:
androiddeployqt --output android-build/ --verbose
This is just a basic usage example, the tool can do much more such as deploying the APK to device, signing the AKC, using a different Qt library deploy methods, etc.