Using the Qt cross-platform APP (Android)

Using the Qt cross-platform APP (Android)

 

This article taught you how in the Windows environment, using Qt compile Android applications.

Qt is an excellent cross-platform development tools. We use Qt application can easily be written once, many times to compile on different platforms, such as Windows, Linux, MAC, Android, iOS, Windows Phone and so on. Developers only need to master the C ++ programming and production methods Qt interface, you can create cross-platform applications, including mobile phones, including the APP.

Note that, Qt support for Android and iOS, UWP and other platforms is not yet perfect. Use Qt to mobile application development, making the finished product either interface, system stability or resource calls, certainly not better to use native development environments. APP students to use Qt to develop software primarily for non-professional, non-APP development industry developers (such as electronic design enthusiasts) to develop APP for debugging , compared to re-learn software development in an even more systems, this is undoubtedly a very save time and effort.

 

1. Install JDK: Java compiler Android application development environment required

https://developer.android.com/ndk/downloads/index.html

Download the latest version under the Windows environment can be installed.

 

2. Install Apache Ant

“Apache Ant is a Java library and command-line tool thathelp building software”

http://ant.apache.org/bindownload.cgi

Download the latest version copied to your target installation directory to decompress.

 

3. Install the Android NDK

Native Android NDK development kit can be used to implement using C / C ++ language constructs Android application.

https://developer.android.com/ndk/downloads/index.html    or

http://tools.android-studio.org/   the bottom to find the NDK

Download the latest version directly extracted. As more files, it is recommended that you copied to the target installation directory to decompress.

 

4. Installation Android SDK

http://tools.android-studio.org/index.php/sdk/

Choose to download the latest Windows SDK Tools, run the SDK Manager After installation, check the following tools.

(If you can not access science, follow http://tools.android-studio.org/index.php/proxy reconfigure the software source)

 

As shown below, according to their needs, select a version of the Android development tools. After clicking "Installxxx packages" can be installed.

 

 

5. Download and install Qt and Qt On Android

https://info.qt.io/zh-cn/download-qt-for-application-development

Register and click the "Get open source packages", then click the green "Download Now" button to download the latest version of the Qt online installer.

Open the installer, just log in registration account, in the "Select components" needed to check the Qt version of the following components. "MinGW" is Qt under Windows compiler tools, the corresponding processor at the beginning of the "Android" Android is the development tool environment, "UWP" namely Windows Phone development tools.

 

 

6. After the installation is complete, open the Qt Creator, Click menu bar "Tools - Options - equipment -Android", configure the JDK, SDK, NDK, Ant's path. Click "Start AVD Manager" to create AVD, after debugging convenience. (Computer configuration can skip the poor, we can use Qt to compile a version of the Windows environment for debugging, be sure to use the apk-generated real test can be directly after the program is not a problem, not encountered due to personal temporarily lead to different environments compatibility issues)

 

 

7.    新建或打开一个Qt工程,在工程配置页面中勾选Android对应处理器的环境。

 

 

8.    在左侧边栏“项目”中,选择Android构建项目,选择“Android build SDK”之后,点击“Create Template”。该操作会在项目根目录创建“android”文件夹与相应文件,并自动在.pro文件中添加创建的文件。

 

 

9.    在弹出的“AndroidManifest.xml”中,可配置包名称、目标SDK版本以及APP版本号、显示名称、图标等信息。右击项目列表中的“AndroidManifest.xml”文件选择“用...打开-普通文本编辑器”可更改如APP屏幕方向等更多的配置,详细方法请看(http://blog.csdn.net/liukang325/article/details/44944267)。

 

 

10.  点击左下角的锤子(编译)按钮,即可编译出Android应用了,目标apk文件将储存在输出文件夹的“android-build\bin”文件夹中。

Guess you like

Origin blog.csdn.net/qq_34106574/article/details/90578959
Recommended