[PySide] PySide for Android & comprehensive build and usage guide

Martin Kolman martin.kolman at gmail.com
Mon Feb 25 00:50:23 CET 2013


24.2.2013 22:55, Stef Mientki:
> On 20-02-13 21:07, robbert wrote:
>>> This basically means, that it is now possible to write Python & PySide
>>> applications that can be installed from standalone APK packages to
>>> non-rooted user devices, just like any other Android application.
>>
>> Great work! This is what I've been waiting for, for a long time.
>> I followed your guide for creating a package (not building PySide).
>> I tried this on two machines, both are able to 'build' a package, and 
>> deploy it to the device. Sadly, both packages give the error: 
>> "Unfortunately, PySideExample has stopped".
>> (Your precompiled package works nicely)
>>
> indeed a great job. !!  but ...
> I tried to run the pre compiled version on  Samsung Note-10 (runs 
> perfect)  and on my Samsung phone S-plus (crashed "Your application 
> encountered a fatal error and cannot continue").
>
> Compiling the package myself, resulted in the same errors as above 
> "Unfortunately, PySideExample has stopped".
> Any clue what's the problem ?

The PySide & QtComponents in the example package were compiled against 
Android API level [1] 14, which corresponds to Android 4.0. Samsung 
S-plus is according to what I've found online running Android 2.3, which 
corresponds to API level 9. The API levels are only forward compatible, 
meaning API 9 should work on device supporting API 14, but not the reverse.

So the next step is to rebuild PySide & Qt Components in the example 
with lower API level - if the build succeeds, the resulting package with 
these binaries should work from Android 2.3 all the way to 4.2.
>
> And in more general, what are the possibilities to debug these kind of 
> errors/problems ?
Application startup & the Qt part of the application prints log messages 
to the main Android log. This log can be either by an on-device 
application [2] or with using the Android debugger (adb) tool over usb 
or network connection. If you have installed the Necessitas SDK, it has 
adb in the necessitas/android-sdk/platform-tools folder.

Once you Android device is in debugging mode, just run adb on PC like this:

adb shell logcat

And the Android log should show up in the console.

For stdout & stderr from the Python code, check:
/sdcard/pyside_example_log.txt
/sdcard/pyside_example_error_log.txt
If no such log file exists, the application crashed before the C++ 
wrapper could start the Python interpreter.
>
> thanks,
> Stef 
Best wishes
Martin Kolman

[1] 
http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels
[2] https://play.google.com/store/apps/details?id=com.nolanlawson.logcat
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20130225/bf523bd2/attachment.html>


More information about the PySide mailing list