Changes between Version 28 and Version 29 of PyOtherSideForAndroid


Ignore:
Timestamp:
Nov 16, 2014, 12:13:46 AM (9 years ago)
Author:
Martin Kolman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PyOtherSideForAndroid

    v28 v29  
    2323For 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.
    2424
    25 Fortunately the [http://doc-snapshot.qt-project.org/qt5-5.3/deployment-android.html#androiddeployqt '''androiddeployqt'''] tools seems to do just that. :)
     25Fortunately the [http://doc-snapshot.qt-project.org/qt5-5.3/deployment-android.html#androiddeployqt '''androiddeployqt'''] tool seems to do just that. :)
    2626
    2727==== Using androiddeployqt ====
     28
     29The '''androiddeployqt''' makes it possible to create android packages (APK) for Qt applications from the command line.
     30
     31But 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:
     32
     33{{{
     34export ANDROID_NDK_ROOT=<path to Android NDK top level folder>
     35export ANDROID_SDK_ROOT=<path to Android SDK top level folder>
     36}}}
     37
     38Note that the NDK should preferably be the same one that has been used for your Python 3 for Android build.
     39
     40Next you need to run ''qmake'' & ''make'' in your project directory to prepare it for '''androiddeployqt'''.
     41
     42Note 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}}}.
     43
     44{{{
     45qmake
     46make install INSTALL_ROOT=android-build/
     47}}}
     48
     49Next run the tool to create an APK:
     50
     51{{{
     52androiddeployqt --output android-build/ --verbose
     53}}}
     54
     55This 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.