Saturday, June 25, 2011

How to Set-up Qt for Android

Download Qt SDK for Android. Install in /opt/necessitas by sudo in terminal.

Download Android SDK and NDK, then extract.

Go to the Android SDK folder under /tools, run ./android

Install SDK version 2.2.

Download Apache Ant 1.8.0 and install OpenJDK SDK. Check by $ant -version

Go to Qt Creator->Tools->Qt4 add qmake path to Qt for Android SDK.

Go to Android tab->Browse the Android SDK, NDK, and Ant. Add AVD (100MB).

Go back to Qt4 tab, Build GDB, QML debuggers (Build All).

Open Project Files and go to Project->Run->Package Configurations Details->Application Libraries and check all.

Go to Deploy Configurations Details->Install Ministro and Download and browse for Ministro.apk.

This will install the Qt libraries to the Android Virtual Device (AVD).

hen creating a Qt Quick project, Add a Resource folder for all QML and contents (.qrc).

Reference Links:

http://sourceforge.net/p/necessitas/wiki/Setup%20QtCreator/
http://sourceforge.net/p/necessitas/wiki/How%20to%20write%20Qt%20apps%20for%20Android/
http://labs.qt.nokia.com/2011/02/28/necessitas/
http://groups.google.com/group/android-qt/browse_thread/thread/74d871e634658bf9

Notes:

You must save your session before shutting down your computer: System->Start-up Applications->Options, then check Automatically remember running applications before logging-out, and click the Remember Current Running Applications.

Don't forget to comment out the set orientation code, or it will have build errors.

Also, once you successfully run the application on the Android emulator, when you open your source code again, don't update it or you will lose changes you've made and you will have to re-install the Ministro and Qt libraries.

No comments: