Pyqt on Android

PyQt on Android

Android does not support PyQt4. However PyQt5 supported (see this). However, you could port your application to use PySide. It provides bindings for the Qt4 platform. You can then use pyside-android.

pyqtdeploy: how to set application icon for Android?

Edit

I have never tried it but @Fred in comment above mentioned this way in Qt Creator - maybe it will work

Edit end

PyQtDeploy is designed for Python code and resources management. App icon is an Android framework thing, so you have to do it Android way - create resource in res folder and reference it in Android manifest.

You can automate the process though - you may create simple bash script that does the thing or one more Python build script with the same purpose - it takes icon from your location moves it to res folder and alters previously generated manifest with the correct reference in form of android:icon="@drawable/your_logo_name".

At least I was doing it like that.

And as a recommendation - if you want to use Python to develop under Android(and cross platform) use Kivy it is much more mature, supportable and complete with much bigger community. It is much faster and has more libs also.

Hope it helps.

Using PySide / PyQt for mobile development

I think its not realistic to think you can use PySide/PyQt and Python in order to make one application suitable for all those platforms.

First of all the platform you want to develop for should support your programming language (Python) as well as the graphical framework (Qt) in order to make it work. This is mostly achieved by third party developers. If Python runs on your mobile operating system this does not say you can start developing and vice versa.

Mobile development is often done with QML (Qt Modeling Language). This allows you to make really cool and fancy interfaces on many platforms. You can connect it to your own Python code to make a real working application.

At this moment Qt is working on support for mobile devices. Most mobile operating systems like iOS and Windows Phone are not supported yet for the combination Python/Qt and mostly the support for working projects is not really big in comparison to the preferred languages of the operating systems.

Here is a list of mobile OS's which support the combination Python/Qt

Link to projects if there is a good link for a starting points is available

Android: PySide for Android

or if you like to use "webviews" instead of PySide: SL4A

Blackberry 10: BB-py

Meego: Python/Harmattan Project

SailFish OS: Harmattan apps (Meego) run without any problem

For your other questions I have a shorter answer.
The webkit component is intended as a content viewer component. Its not a component for building full HTML 5 apps.

The question which bindings for Qt are better is often asked. What you need to be aware of is that the old version of PyQt did almost the same as PySide. The difference was mainly in the license! However PyQt supports now Qt 5 while PySide doesn't, so make your own choice. I think you can make beautiful apps with both of them.

Deploying PyQt5 application to Android via pyqtdeploy and Qt5

Wait for the next release of pyqtdeploy, which will probably give better instructions or include cross-compiled libraries. The pyqtdeploy project is being actively developed. Yes, you can use it for Android now, but you are on your own for cross-compiling many static libraries.

How to add required libraries to a pyqtdeploy project file for an Android app?

Luckily I found a solution.

It's not documented anywhere so I only know this workaround.

Before running androiddeployqt I had to copy a valid QML file into the build-directory where androiddeployqt can find this file.

Have a look into the android-lib*.so-deployment-settings.json file in the build-directory for the key "qml-root-path":

There a qml-root has been set. In my case it was build-android-32.

androiddeployqt is scanning this file and maybe also dependent qml files for import statements. And then it knows which additional libraries to deploy.



Related Topics



Leave a reply



Submit