First of all, download all the tools:
1. Qt for Android:
Http://qt-project.org/downloads
2. Android NDK
Http://developer.android.com/tools/sdk/ndk/index.html
64-bit can download a second
3. Apache Ant 1.9.3
http://ant.apache.org/bindownload.cgi
4. JDK
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
JDK is available in multiple versions, at least 1.6 or more, 64-bit
5. Android SDK
This special note, the latest version available on the website is 20140321. This version looks like Qt can not recognize, even if the Android 2.3 also added in the inside also can not be identified, I later changed a 2013 version of the success.
Therefore, must go to Baidu search adt-bundle-windows-x86-20131030 or adt-bundle-windows-x86_64-20131030. Other versions I have not tried, you are interested can try.
After the download is installed, only QT and JDK need to be installed, other direct decompression can be.
When installing Qt5.2.1, you must tick all, Qt5 MinGW and Qt4 are different.
JDK is basically all the way next, not much to say.
After installing the JDK, set the environment variable java_home, which can be set at the user variable:
When Setup is complete, launch SDK Manager.exe in the SDK
According to the need to choose the platform, my phone is 2.3, so choose 2.3.3 in the SDK Platform, the other do not tick.
then click Install.
Once the installation is complete, the QT creator will start running.
Select "Tools"-"Options",
Select Android on the left:
Fill in the path:
The middle exclamation mark is out of control.
And then select
Select a resolution, then select Create
Fill in the information and select OK
Returns the QT settings, the list of discovered devices is empty.
You should close the Settings window and reopen it to see the
Select your new device and click Start on the right.
The equipment is running up ~
Next choose not to turn off the device, go back to Qt Creator, create a new project, GUI or QML can be
When you select Kit, be aware that you want to correspond to the new version of the device.
To select Widgets here
However, when the build target is Android, the following prompt is available:
This is a hint to the NDK environment variables problem, turn off Qt Creator, and then decisively add:
Start QT Creator again, open the project
Still will report the error prompt, this time does not suggest wrong where.
No matter, dead horse when live horse medicine, casually drag several controls to try, direct point run:
After 3 or 4 minutes of compiling subordinates, you will see:
It worked! Even the message box is Android-style.
And look at the desktop version.
Exactly as there are wood there.
Finally, look at the Android-build\bin in the project directory, you will find an APK, you can copy to the phone to try ~
Reprint please indicate source: http://www.cnblogs.com/ztzheng/p/3703716.html