/ ANDROID, C/C++, MAC OS X, NECESSITAS, QT

Experiment Necessitas: Qt apps on Android

Some weeks ago I read about the Necessitas project on the Qt Labs Blog which let you able to run Qt application on the Android platform. It was very interesting and now I’m going to try it.

My test environment is my Mac Book Pro with Snow Leopard.

Unfortunately the installation of Necessitas on Mac OS X is done by an online installer so you must be prepared to wait half a hour for the installer to download all the packages it needs. The installation packages can be found in the Downloads page.

Now you can start the Necessitas version of Qt Creator inside the QtCreator/bin folder and select Qt Widget Project > Qt Gui Application to create a new empty project.

Choose name for your project, i.e. Android, and the folder where the project tree will be created. You can set up that folder as your default folder for your future Qt projects if you wish.

Now select Android as a build target

Next step the creation of the class for the main application and window, the default values are fine for now

The last step asks you to select which version control system do you want to use, None is a fine for now

Now we have our Android test project ready, we must create a new virtual device by entering Projects > Targets > Run > Manage device configuration and press the Add button in the AVD Manager box. State a name for the new emulated device, a target API level and the size in Mib of the SD card.

Close the Manage device configurations window, expand the Package configuration panel an set the Android target SDK to the same one of the newly created device

Now expand the Deploy configurations panel, check the Install Ministro system wide qt shared libraries installer and select the .apk of Ministro from your hard drive. The .apk can be download from here.

Now you are ready to run your empty project into the emulator. When you run it for the first time you will prompted by Ministro to download the required Qt libraries into the emulator; let Ministro do it for you and

And at the end you will see your empty project in action

Well, a white screen is not a big achievement but in this post we are talking about run a Qt application on Android and not about the application itself.

In the next post I’ll talk more about run the same application under desktop version of Qt and Android.

Stay tuned !!