You are browsing the archive for Python.

PySide for Android (using Necessitas)

July 9, 2011 in Qt framework, Uncategorized

I’ve been working on getting PySide (LGPL’d Python bindings to Qt, see http://pyside.org/) to work on Android this week, using the Py4A project and Necessitas. I’ve collected the results on this page:
http://thp.io/2011/pyside-android/

PySide for Android lets you write Qt or QML UIs for Android – all in pure Python. The projects on which PySide for Android builds upon are:

pyside android

Some remarks/problems that I ran into:

  • Qt Creator does not allow me to put libraries into libs.xml – they get overwritten (and deleted) when building the project (I’ve manually fixed this by editing libs.xml by hand and copying the shared libraries in there after having built the project, and then rebuilding the APK without Qt Creator using “ant install” in the “android/” folder of my project)
  • The libraries downloaded by Ministro are different from the libraries in the Necessitas SDK (the dynamic linker in the emulator had problems that were fixed when I overwrote the Ministro libraries with the (stripped) libraries from the Necessitas SDK) – is this a known problem and will it be fixed?
  • If the library downloads in Ministro are interrupted/incomplete for some reason, it will act as if the library was downloaded (but applications trying to use the libraries will fail) – manually deleting the affected incomplete files fixes the problem and causes Ministro to redownload the files
  • QtGui on Android does not support QSound (at least I had problems when building PySide) – is this a known problem?
  • Also QtOpenGL does not seem to be properly supported – is this being worked on, or is this out of scope?

Looking forward to your feedback and suggestions. I’d also be happy to hear your opinion about the current way of packaging, and if it could be made easier, etc..

Thomas Perl announced it on android-qt group

Scripting in Android

June 13, 2011 in Java, Programming

Scripting Layer for Android (SL4A) brings scripting languages to Android by allowing you to edit and execute scripts and interactive interpreters directly on the Android device. These scripts have access to many of the APIs available to full-fledged Android applications, but with a greatly simplified interface that makes it easy to get things done.

Scripts can be run interactively in a terminal, in the background, or via Locale. Python, Perl, JRuby, Lua, BeanShell, JavaScript, Tcl, and shell are currently supported, and we’re planning to add more. See the SL4A Video Help playlist on YouTube for various demonstrations of SL4A’s features.

SL4A is designed for developers and is alpha quality software. Please report bugs and feature requests on the issues list. You can download the current APK by scanning the barcode.

To install SL4A, you will need to enable the “Unknown sources” option in your device’s “Application” settings.

Still have questions? Check out the FAQdiscussion list, or join #sl4a on freenode.

YouTube Preview Image
YouTube Preview Image

Source here.