How to Create and Run Qt Application for Android
English Български
How to Create and Run Qt Application for Android
Using Necessitas [developer.qt.nokia.com] Qt SDK developers can deploy Qt application on Android devices. The following tutorial will show the basics steps to create a simple Qt application for Android.
Requirements
- Installed Necessitas SDK
- Android device
Tutorial
- Start Qt Creator from Necessitas Qt SDK
- Press File > New file or project… and follow the instructions of the wizard
- Select Qt Widget Project and Qt Gui Application
- Enter project name and path to its directory
- Select Android as a Target
- When the project is created open the Projects view and verify the configurations for Build and Run settings
- Modify the source code and when ready run the application on the device
Hints
- To modify general information about the application, Android Manifest file, Android Permissions or the list of libraries from Qt Creator go to Projects > Run Settings > Package configuration > Details.
- To select Android target SDK that you want to use from Qt Creator go to Projects > Run Settings > Package configuration > Details > Manifest.
- To modify deploy configuration of the project from Qt Creator go to Projects > Run Settings > Configuration configuration > Details.
Source Code
As you can see the source code does not include any specific Android features which makes absolutely portable. Some additional files required by necessitas are added at pro file of the project.
- test.pro
- main.cpp
- mainwindow.h
- mainwindow.cpp
Testing
Connect your device to the computer and run the application from Necessitas Qt SDK Qt Creator. The Qt application will automatically start on the Android device. You might be prompted to download dependencies using Ministro. Follow the instruction to install all required components.
This example application has been successfully tested on LG GT540 Optimus [gsmarena.com] with Android 2.1.
See Also
How to use Necessitas 0.2.1 Emulator on Windows 7 [developer.qt.nokia.com]
How to write Qt apps for Android [sourceforge.net] to write Qt apps for Android/
Setup QtCreator [sourceforge.net] QtCreator/
How to install Necessitas SDK [sourceforge.net] to install Necessitas SDK/