i.MX6ULL development board QT application development Qt for Android

QT is a very good cross-platform tool. So we only need to master the method of QT as an interface, and we can easily make QT cross-platform applications.
Why learn QT_For_Android?
1. Experience the superiority of QT's cross-platform
2. It is very suitable for our non- disciplinary background developers to develop and debug APP.

1 Set up a development environment

1. Install the JDK, select the default path, and click Next all the way.

After the installation is complete, enter the corresponding path to view:

Issues that need attention:
(1) It is recommended to use the version we provide, if you download it yourself, problems may occur.
(2) It is recommended that you install it under the C drive, without the Chinese path.
2. Install sdk and ndk, just unzip it directly, and the unzip path should not have the Chinese path. I have extracted it here to the installation path of the JDK. If the C drive space is not enough, you can extract it to other drives, but remember the location, you need to use it below.

3. Configure the environment
Open QTCreator, open Tools -> Options, and select the content shown in Figure 1.4:

Set the path of JDK, SDK.NDK, as shown in Figure 1.5:

After the setting is complete, we can click apply and ok.

2 Make Android APP

Activate the compiler, click Project -> Android Compiler, and then you can see the Android compiler in the lower left corner.

Switch the compiler to the Android compiler, as shown in Figure 2.2, then connect to the mobile phone, and the development board to OTG.

Connect the mobile phone or the development board (the development board burns the Android system), check whether there is any problem with the compilation tool, whether it reports an error, if not, you can proceed to the next step.
Click run to see if we have found our mobile phone or development board, and whether Android Device appears in the device manager. If not, you need to check whether the adb driver is normal. Use the driver wizard to check whether the driver is normal, and Whether the usb of the mobile phone or the development board allows debugging is turned on, the debugging of the usb of the mobile phone is in the developer mode.

After identifying the development board or mobile phone, click run to start compiling. Note that the computer must be connected to the Internet at this time. It will not work if it is not connected.
There may be errors encountered:
what went wrong: the
cause of the problem: was walled.
Solution: Replace the source.
Enter the compiler setting options: as shown in Figure 2.4:
Click the project, click the details of Build Android APK, click Create Template, and click Finish.

Then we will get a lot of files under our project. We click on the build.grade file and comment out jcenter, as shown in Figure 2.5:

Then add the following code to the build.grade file,
comment out the two jcenters, and add new sources (Alibaba Cloud) below:
maven { url 'https://maven.aliyun.com/repository/jcenter'}

As shown in Figure 2.6:

After the compilation is completed, the APP will be automatically installed on the development board or mobile phone,

Set the APP icon: open the project file .pro, the bottom is the project folder, and put the icon in this folder.
The icon format must be PNG format.

Then select AndroidManifest.xml in the generated file, fill in the APP name, the edit field of Run must be consistent with the project name, and the three icons of Application icon below must be filled in. As shown in Figure 2.9:

The path of the generated APK is in the project directory
build-time-Android_for_armeabi_v7a_GCC_4.9_Qt_5_11_1_for_Android_armv7-Debug\android-build\build\outputs\apk

After success, as shown in Figure 2.11:

 

Guess you like

Origin blog.csdn.net/mucheni/article/details/113727588