Changes between Version 28 and Version 29 of PySideForAndroid
- Timestamp:
- Feb 17, 2013, 10:33:02 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PySideForAndroid
v28 v29 129 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 130 {{{ 131 /data/data/org.modrana.PySide.Example/ 131 /data/data/org.modrana.PySide.Example/files/ 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/ 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. … … 220 220 The first archive, located in {{{android/res/raw/my_python_project.zip}}} in the project contains the Python application code. On first application start, it's contents are unpacked into: 221 221 222 {{{/data/data/org.modrana.PySide.Example/ }}}222 {{{/data/data/org.modrana.PySide.Example/files/}}} 223 223 224 224 ====== python27.zip ====== 225 225 This file is located {{{android/res/raw/python_27.zip}}} in the project and it's content is unpacked to: 226 226 227 {{{/data/data/org.modrana.PySide.Example/ python}}}227 {{{/data/data/org.modrana.PySide.Example/files/python}}} 228 228 229 229 The paths set in {{{main.h}}} expect this and point the corresponding environmental variables to the {{{bin}}}, {{{lib}}}, {{{imports}}} and {{{themes}}} folders in this directory. … … 312 312 The application is located in: {{{android/res/raw/my_python_project.zip}}} 313 313 314 This file is decompressed into the {{{/data/data/org.modrana.PySide.Example/ }}} folder on first start after installation. Then {{{/data/data/org.modrana.PySide.Example/main.py}}} is run by Python.314 This file is decompressed into the {{{/data/data/org.modrana.PySide.Example/files/}}} folder on first start after installation. Then {{{/data/data/org.modrana.PySide.Example/files/main.py}}} is run by Python. 315 315 316 316 To replace the example application, just replace the contents of {{{my_python_project.zip}}}, if you want to start other file than {{{main.py}}}, just change the ''MAIN_PYTHON_FILE'' path in {{{main.h}}} . 317 317 318 318 ===== Replacing Python ===== 319 The project contains two Python "bundles", one is used to compile the application wrapper and is located in {{{build_dependencies/python}}}, the other one is in {{android/res/raw/python_27.zip}}} and is deployed on first start after installation into {{{/data/data/org.modrana.PySide.Example/ python}}} with all other bundled libraries and files in this archive.319 The project contains two Python "bundles", one is used to compile the application wrapper and is located in {{{build_dependencies/python}}}, the other one is in {{android/res/raw/python_27.zip}}} and is deployed on first start after installation into {{{/data/data/org.modrana.PySide.Example/files/python}}} with all other bundled libraries and files in this archive. 320 320 321 321 When replacing Python, you should probably replace both bundles with the same Android-compiled Python version, or at least use the same series (2.7 & 2.7 not 2.7 & 2.6). 322 322 323 323 ===== Replacing !PySide libraries ===== 324 The !PySide libraries are located in {{{android/res/raw/python_27.zip}}} archive inside the ''lib'' folder. This folder is deployed to {{{/data/data/org.modrana.PySide.Example/ python/lib}}} on the Android device.324 The !PySide libraries are located in {{{android/res/raw/python_27.zip}}} archive inside the ''lib'' folder. This folder is deployed to {{{/data/data/org.modrana.PySide.Example/files/python/lib}}} on the Android device. 325 325 326 326 When replacing !PySide, you need to replace the libshiboken and libpyside: