Changes between Version 28 and Version 29 of PySideForAndroid


Ignore:
Timestamp:
Feb 17, 2013, 10:33:02 PM (11 years ago)
Author:
Martin Kolman
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PySideForAndroid

    v28 v29  
    129129The 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:
    130130{{{
    131 /data/data/org.modrana.PySide.Example/
     131/data/data/org.modrana.PySide.Example/files/
    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/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.
     
    220220The 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:
    221221
    222 {{{/data/data/org.modrana.PySide.Example/}}}
     222{{{/data/data/org.modrana.PySide.Example/files/}}}
    223223
    224224====== python27.zip ======
    225225This file is located {{{android/res/raw/python_27.zip}}} in the project and it's content is unpacked to:
    226226
    227 {{{/data/data/org.modrana.PySide.Example/python}}}
     227{{{/data/data/org.modrana.PySide.Example/files/python}}}
    228228
    229229The paths set in {{{main.h}}} expect this and point the corresponding environmental variables to the {{{bin}}}, {{{lib}}}, {{{imports}}} and {{{themes}}} folders in this directory.
     
    312312The application is located in: {{{android/res/raw/my_python_project.zip}}}
    313313
    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.
     314This 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.
    315315
    316316To 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}}} .
    317317
    318318===== 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.
     319The 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.
    320320
    321321When 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).
    322322
    323323===== 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.
     324The !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.
    325325
    326326When replacing !PySide, you need to replace the libshiboken and libpyside: