Qt on Android and BB10 experience

Finally I have managed to port a small desktop app to Android and Blackberry 10. The app was based on QWidgets and was based on Qt 4.8.  The app was not for open distribution unfortunately so I can’t share the app. However, I can share some experiences:

Blackberry 10:  I just changed to the Blackberry-provided qmake, ran qmake and make, and the app compiled without any changes for Blackberry 10. However, packaging the app requires a few additional steps. You have to obtain signing keys (which I already had), provide a bar-descriptor.xml and then run the blackberry-nativepackager command. The process is generally well-documented and went fine. I was able to test on a Blackberry Z10. I initially ran into an issue that I had forgotten to specify the proper permissions in the bar-descriptor for accessing files, but once I corrected it things ran “ok”. Most of the widgets actually rendered fine and layout scheme worked as expected. However, things were not perfect either. For example, the file picker dialog was not very nice but at least the app was servicable. The lack of integration with BB10 UI conventions is an issue though so will have to see if there is a way to integrate stuff like swipe-down menus from a pure QWidget (or perhaps Qt Quick 1/2) based app without using Cascades.

Android:  For Android, I used Android 5.1 and actually used Qt Creator 2.8.1 to set everything up. Changing to Qt 5.1 required very minimal changes such as a couple of ifdefs for changed header file names. Qt Creator asked for Android SDK and NDK paths, and after that setup most of the things automatically including inbuilt simulator support. If you connect a device over adb, those are recognized as well for deployment and testing.  Qt Creator was automatically generating unsigned APKs but doesn’t seem to generate signed apk’s, or at least I couldn’t figure out how.
Overall, things were going smoothly on Android .. until I actually ran the app. Turns out QWIdgets look really ugly on Android and some of the layouting doesn’t really work the way you would want. Some widgets, like QComboBox used for implementing drop-down menus, did not render correctly while some others like file dialogs were ugly and almost unusable. After a few careful changes, I was able to make it work but still integration was poor.

I would say, at least on Android, you should try to avoid QWidgets and start to use QML. QML will allow you far more control over the look, feel and layout of your app. I do hope that something like Qt Quick Controls come to Android because raw QML is a bit too much DIY. The other issue is that, I am still not clear on how Qt based apps can integrate with Android UI guidelines such as integration with the back button.  I am also not clear how you can integrate, say, invoking the email application or the web browser. Need to figure these out next.

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *