Windows Qt5.2 for Android development environment setup

Source: Internet
Author: User

Windows Qt5.2 for Android development environment configuration

1. Download and install QT 5.2.0 for Android (Windows 32-bit) http://qt-project.org/downloads

2. Open QT Creator, open Help, enter Android, find the official instructions, follow the steps of the tutorial step by step.

3. You need to download the following four software first:

1) The Android SDK Tools download installation

2) The Android NDK download and unzip, note that there can be no spaces

3) Apache Ant v1.8 or later download and unzip, ditto

4) OpenJDK V6 or later download and unzip

4. Open qt Creator, select Tools-Options-android, configure the file path just installed, and click "Launch Android AVD Manager"

5. Click New to create a new Android emulator, select device according to your needs

6. Click on the Ok-ok and select the device you just created, click Start, this process is slow, wait patiently.

Recommendation: Real machine development, will speed up development

7. Restart QT Creator already has the device, we check the build and run build suite and QT version is correct.

Check the component kit:

If the debugger is none, you also need to add a debugger to add the interface such as:

Will%pwd\android-ndk-r9b\toolchains\arm-linux-androideabi-4.8\prebuilt\windows\bin\ Arm-linux-androideabi-gdb.exe Add to Debuggers

Confirm the error and then you can build the project.

8. Create a new sample project with the following steps

To add a file or project in the first step file:

Second Click to select:

The third step is to click Next:

After setting up the kits, select the next step directly, and finally select Finish.

9. Replace the main.cpp code to show Hello Qt

10. Click build directly to see if the normal compilation, if the error here, you can leave a message, try to solve for everyone. Everything is normal. Click Run, this process is slow, will be compiled into an APK file and deployed to the emulator.

Some settings for Android programs can be modified in the project properties

Specific settings can be viewed in the QT help.

11. Start the debugging process, such as:

When you start debugging, you will encounter the following screen:

The interface does not affect debugging, click OK to skip.

Simple debugging methods such as VS and print log

Print the Log method: qt debugging do not use printf when using qwarning ("Cannot find the example directory"); Directly under the console or the log file output (the implementation is included in the main.cpp)

This is the end of the environment!

Other problems encountered:

Solution: A problem with text encoding. Basically you have to open the GB2312, GBK code, you in the settings to change to GB2312, good,

http://blog.csdn.net/liuguangzhou123/article/details/17050251

Windows Qt5.2 for Android development environment setup

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.