Changes between Version 31 and Version 32 of PySideForAndroid


Ignore:
Timestamp:
Feb 18, 2013, 12:08:26 AM (11 years ago)
Author:
Martin Kolman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PySideForAndroid

    v31 v32  
    4949It first builds Shiboken, followed by !PySide. The script is fully automatic, but waits for the user to ''press any key'':
    5050* after Shiboken is configured for build
    51 * after PySide is configured for build
     51* after !PySide is configured for build
    5252Like this you can easily check for any errors during configuration.
    5353
     
    5959The resulting !PySide libraries compiled for Android are located in the ''stage/lib'' folder.
    6060
    61 See the ''Example project for the Necessitas Qt Creator'' section for how the PySide libraries can be used as a part of a self-contained Android application.
     61See the ''Example project for the Necessitas Qt Creator'' section for how the !PySide libraries can be used as a part of a self-contained Android application.
    6262
    6363
     
    125125
    126126==== How does it work ? ====
    127 The project contains various components, that together enable the creation of fully standalone Python & PySide application APK, while also allowing to bundle any arbitrary libraries and files needed by the application.
    128 
    129 The example project is called ''PySideExample'' and uses the ''org.modrana.PySideExample'' unique name. this means, that when it's APK is installed on and Android device, it gets installed to this directory:
    130 {{{
    131 /data/data/org.modrana.PySide.Example/files/
     127The project contains various components, that together enable the creation of fully standalone Python & !PySide application APK, while also allowing to bundle any arbitrary libraries and files needed by the application.
     128
     129The example project is called {{{PySideExample}}} and uses the {{{org.modrana.PySideExample}}} unique name. This means, that when it's APK is installed on and Android device, it gets installed to this directory:
     130{{{
     131/data/data/org.modrana.PySide.Example/
    132132}}}
    133133This path is important, as the application needs to set a couple of environmental variables during startup, pointing to libraries and themes that reside in this directory.
     
    136136The {{{main.cpp}}} and {{{main.h}}} files are used to build a C++ Python wrapper. This wrapper is build against the the Android-compiled python libraries in {{{build_dependencies/python}}} by Necessitas.
    137137
    138 Once the APK is deployd to the device and started, this wrapper is run. It initializes it's build-in Python interpreter, which tries to start the {{{/data/data/org.modrana.PySide.Example/files/main.py}}} Python file. This Python code then imports PySide, instantiates a QApplication and starts the main loop.
     138Once the APK is deployd to the device and started, this wrapper is run. It initializes it's build-in Python interpreter, which tries to start the {{{/data/data/org.modrana.PySide.Example/files/main.py}}} Python file. This Python code then imports !PySide, instantiates a QApplication and starts the main loop.
    139139
    140140Behind the scenes, Necessitas handles wrapping the QApplication to an Android activity and showing it on the screen. It also handles other stuff like keyboard input & Qt Mobility.
     
    160160
    161161#define QML_IMPORT_PATH "/data/data/org.modrana.PySideExample/files/python/imports/"
     162
     163#define PYSIDE_APPLICATION_FOLDER "/data/data/org.modrana.PySideExample/"
    162164
    163165#endif // MAIN_H
     
    175177
    176178===== The example Python application =====
    177 The example application is basically a normal !PySide application, it imports !PySide, instantiates QApplication and starts the main loop. There is only one main difference in this piece of code:
     179The example in {{{main.py}}} inside {{{my_python_project.zip}}} is basically a normal !PySide application, it imports !PySide, instantiates QApplication and starts the main loop. There is only one main difference in this piece of code:
    178180
    179181{{{
     
    368370== Ideas for improvement ==
    369371There is definitely still room for improvement, such as:
    370 * a script that renames & customizes Necessitas Qt Creator PySide projects
     372* customizes Necessitas Qt Creator !PySide projects
    371373* building APKs from command line only without Qt Creator
    372374* show a progress bar when the bundled libs are unpacked on first start