This post participates in the contest "Smart phones for smart posts . "It so happened that I have some experience in developing applications for Qt, and recently a communicator appeared on Android. Having learned that there is a project
Necessitas (previously it was called Android-Lighthouse), I wanted to check the possibility of launching Qt applications for Android in practice.

')
To start the program migration, you need to install the Necessitas SDK (there are versions for Linux, Windows, MacOS). It includes Qt Creator, various Qt components, own libraries, and also installs the Android SDK and NDK if they are not already on the computer.
In the settings window (Tools-> Options) of Necessitas Qt Creator there is an additional tab - Android. Otherwise, the properties of the project also look, there appear options typical for Android, like permissions for using phone resources. You also need to clearly indicate which libraries the application uses (in my case they were QtCore, QtGUI, QtDeclarative). If you do not specify the required library or do not specify a name for the application, the output will be idle .apk.
For testing on a real device, you need to dig deeper also with adb. This is probably familiar to anyone who is developing something for Android under Linux, but for those who come from the world of Qt this may be unexpected. In order for the device to be available for application deployment (and Qt Creator did not crash when it cannot find such a device), you need to
configure the USB settings and restart adb under the root:
cd / opt / necessitas / android-sdk-linux_x86 / platform-tools /
./adb kill-server
sudo ./adb start-server
Qt-applications can only be built under Android 2.2 and higher, if you select an older version, an error will appear during compilation. If errors occur during the build, you should delete all the .pro.user files from the project folder, leaving only one .pro file, and reopen the project in Qt Creator.
The rest of the Necessitas SDK is done perfectly - it is configured in 5 minutes, and the output is ready for installation. Apk.


When the program is launched on the device for the first time, it downloads the Ministro application from the Android Market. It acts as a bridge between the Qt application and the operating system, loading the libraries needed by a specific Qt application. When you first start the library is downloaded from the web, then just loaded into memory.
Having figured out how it all works, I was able to successfully compile and run the
OppiaSanoja program for learning foreign words that was
flashed on the
Frono ZTE Blade communicator. Necessitas correctly supports the basic functionality it needs - drawing QML (with respect for the proportions and appearance of the elements - everything looks exactly like on Maemo and MeeGo), working with the file system, accessing QSettings (though all settings are reset when you reinstall the program, what does not happen, say, on Maemo).

The developer and other interested parties can use the product quite well - there are no critical flaws and limitations in Necessitas (although for more complex programs it may not be enough, for example, OpenGL hardware rendering). And just the spectacle itself is fascinating - the kind of running Qt-application on the Android-device. But it is too early to move such works to the masses. Here are the errors that were found even in a simple program:
- If the application is inactive and it is restarted, an error window is displayed. This problem is typical for Android, since on the Nokia N900 the same application hangs in the background for weeks and correctly recovers.
- When recovering from the background, the current QML view is not drawn (the user will see a black screen until he starts to poke around the screen or slide). This problem has already been
noticed by the developers , it will be fixed in one of the future versions.
- The virtual keyboard remains on the screen always, being called at least once (of course, the user can remove it by pressing the back button, but it would be better if the program itself could do it).
- And finally, despite the clear assignment of landscape orientation only, Ministro works on the sensor and translates the program into portrait mode if the user rotates the device.

Perhaps some of these issues can be solved one way or another, but Necessitas does not have extensive documentation, and ignored these questions on the mailing list (as, by the way, most of the others are ignored).
Summing up, we can say that now Necessitas is rather a beautiful toy for geeks (by the way, there is a version for launching Qt applications on Bada) than a real-life framework in development (the impossibility of creating mass applications at the moment is also mentioned on ).
Considering the situation in Nokia and the small number of Necessitas developers, it is unlikely that in the near future it will be possible to create Qt-applications for Android for release to the masses. However, you can always join the project (Necessitas works on the principle of open source) and work on improving the Qt + Android bundle.