Changes between Version 31 and Version 32 of PySideForAndroid
- Timestamp:
- Feb 18, 2013, 12:08:26 AM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PySideForAndroid
v31 v32 49 49 It first builds Shiboken, followed by !PySide. The script is fully automatic, but waits for the user to ''press any key'': 50 50 * after Shiboken is configured for build 51 * after PySide is configured for build51 * after !PySide is configured for build 52 52 Like this you can easily check for any errors during configuration. 53 53 … … 59 59 The resulting !PySide libraries compiled for Android are located in the ''stage/lib'' folder. 60 60 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.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. 62 62 63 63 … … 125 125 126 126 ==== 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/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/ 132 132 }}} 133 133 This 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. … … 136 136 The {{{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. 137 137 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.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. 139 139 140 140 Behind 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. … … 160 160 161 161 #define QML_IMPORT_PATH "/data/data/org.modrana.PySideExample/files/python/imports/" 162 163 #define PYSIDE_APPLICATION_FOLDER "/data/data/org.modrana.PySideExample/" 162 164 163 165 #endif // MAIN_H … … 175 177 176 178 ===== The example Python application ===== 177 The example applicationis 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:179 The 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: 178 180 179 181 {{{ … … 368 370 == Ideas for improvement == 369 371 There is definitely still room for improvement, such as: 370 * a script that renames & customizes Necessitas Qt CreatorPySide projects372 * customizes Necessitas Qt Creator !PySide projects 371 373 * building APKs from command line only without Qt Creator 372 374 * show a progress bar when the bundled libs are unpacked on first start