Qt5.3.0 for Android Windows platform build and demo (Bug blog)

Source: Internet
Author: User

~ ~ ~ My life, my little drops!!

Department leaders suddenly whim, want to do the application on the Android platform, but most of our products are embedded (this crane is only responsible for writing applications, bitter than the force of the top come to do this, because this also has to lead a quarrel, although the fight, the task to do AH), spit trough, we enter the theme, In the embedded is generally C + +, Android What Java what, completely not ah, fortunately QT out of support Android platform, then I would like to try (if the full-time Android platform application or recommend the use of the original eco-Android to develop it, after all, QT for Android Package size is a problem)

First, download the latest QT version

Http://qt-project.org/downloads Download the latest QT for Android SDK package, Qt-opensource-windows-x86-android-5.3.0.exe-free compilation Yes, Free to install Qtcreator Ah, free from trouble, free .... (You put him on the right), the installation does not need you to do, all the way next, it seems that the installation process is very slow, visual inspection for at least 15 minutes

15 minutes later ....

OK, we finally installed, we "can't Wait" to open qtcreator (note that we installed, not your previous installation), may be a lot of seemingly serious errors, but it doesn't matter brave open, go to the place to aim "Tools"----> Options----> "Build and Run"

Red circle places should have a red prompt, prompting us to have a problem (I do not have a hint here because the picture is I configured the cut), the Android ARMv7 is our future compile Qt for Android Code of the compilation tool chain, so be sure to fix him, we add him into the system environment, We add C:\Qt\Qt5.3.0\5.3\android_armv7\bin in path;

Something else can be ignored, let's go see what's under Android

Look at the markings on the top 1-4 that's where the Android environment is configured, the focus of this blog post is here, the environment is configured right, with less effort Ah, we take the above what we need to download

An hour is omitted here ... (Download it yourself)

Do not worry about their version of the problem, directly full download the latest, there are more new under how new, they look as follows:

We're going to start working after the download.

1. Installing the JDK

First install the JDK, if you are afraid of error, you can install the default installation path bar, after the installation of the following directory:

C:\Program Files\java

|-----jdk1.7.0_25

|-----jre7

Focus:

To set the environment variables for Java:

Our new key system variable name java_home variable value C:\Program files\java\jdk1.7.0_25

We are building a classpath with a value of .; %java_home%\lib;%java_home%\lib\tools.jar;

Everyone notice that the front is there .; , he said the current directory, to this JDK environment settings, you can enter the cmd under the java-version will output information

2. Installing the SDK

Unzip Adt-bundle-windows-x86-20130729.zip to your own designated directory, I put in C:\adt-bundle-windows-x86-20130729 (note the middle path do not have Chinese, do not have spaces) The directory structure is as follows:

C:\adt-bundle-windows-x86-20130729

|-----Eclipse

|-----SDK

|-----SDK Manager.exe

To put it simply,

The Eclipse directory is the directory of the famous Eclipse IDE, used to start the original eco-Android

The SDK directory is like the QT SDK, and everything Android needs is underneath him.

SDK Manager.exe used to download and update the Android package, but at present because of GFW to Google's overall ban, you want to use him want to not, impossible to even, so if you want to download each version of the API level to find the domestic mirror it

Focus:

To set the SDK environment variables:

New Key System variable name android_sdk_root variable value C:\adt-bundle-windows-x86-20130729\sdk\platform-tools; C:\adt-bundle-windows-x86-20130729\sdk\tools

Add%android_sdk_root% in Path, and enter Emulator.exe validation in cmd

3. Installing the NDK

Unzip the android-ndk-r9-windows-x86.zip into the C:\ANDROID-NDK-R9 directory (the directory is too much, I will not list it), the NDK is used to compile C, C + + code

Follow the above method new key

Then add the%android_ndk_root% in path;

4 Installing the Packaging tool ant

Unzip Apache-ant-1.9.2-bin.zip to C:\apache-ant-1.9.2

Environment variables

Add%ant_root% in Path;

PS: In fact, the good way is to put them all in a directory, so easy to manage!

With the above settings, we can go to the Qtcreator to add the Android environment path, add the result diagram

Above the red circle for them on the right side of the path for adding an Android simulator, below is the display of this simulator, we'd better not use his, and card!! It's slow!! It's unbearable, directly connected to the real machine debugging, if you want to use the Qtcreator in the real machine debugging please remember to use qtceator3.x version , to this environment set up, we go to build a project to play

Second, the new Qt5 for Android project

File------->>>> new project or project-------->>>> application-------->>>>qt Widgets application------ ->>>> all the way next to the selection tool chain, watch

The following two, you can not choose, but the above must be selected!!

Then the normal compilation---->>>> run then can be published to the Android platform, at run time will appear the selection dialog box, let you choose on what to run

Select the device we want to run, it is OK, it will be a bit slow, about 20 seconds or so, this process can be in the Qtcreator "compile output" and "application output" inside see some output information, he can be convenient for us to locate some errors!

---------------------good, to this finish Qt5 for Android environment configuration, you can simply use QT to do the development of Android platform, as for good and bad, are relative, see how you choose!!

http://blog.csdn.net/ac_huang/article/details/34856849

Qt5.3.0 for Android Windows platform build and demo (Bug blog)

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.