Qt on Android: Application name: Chinese, qtandroid

Source: Internet
Author: User

Qt on Android: Application name: Chinese, qtandroid

This morning, a friend in the group asked me how to set the name of the Android app developed by Qt to Chinese. I tried two methods.

    After the blog contest finals, please vote for me: the Qt Quick image processing instance meitu xiuxiu (with source code download). Thank you.

Link to the original article: Qt Quick image processing instance meitu xiuxiu (source code download)

Directly modify the AndroidManifest. xml file

First, you must create an AndroidManifest. xml file when creating the Qt on Android project. If you do not know how to create it, refer to my article "Qt on Android: full process of Hello World".

Open the AndroidManifest. xml file in Qt Creator and switch to the XML source code mode. 1:


Figure 1 modify AndroidManifest to implement the Chinese Application name

Modify the application and activity labels at the same time, save, run, and OK.

App list 2 on mobile phone:


Figure 2 mobile app list

See, "Chinese application" in the upper left corner.

Add a Chinese string File

The first method, in fact, is violent, undermining the international framework provided by Android. The second method is recommended.

First, create the AndroidManifest. xml file.

Open the project directory, find the android sub-directory, and create the path res/values-zh-rCN. Create a New strings. xml file in UTF-8 format. The file content is similar to the following:

<? Xml version = '1. 0' encoding = 'utf-8'?> <Resources> <string name = "app_name"> Chinese application </string> <string name = "ministro_not_found_msg"> the Ministro service cannot be found. \ N application cannot be started. </String> <string name = "ministro_needed_msg"> This application requires the Ministro service. Do you want to install it? </String> <string name = "fatal_error_msg"> your application encounters a fatal error, causing it to fail. </String> </resources>

Finally, run your Android project to see the same effect as method 1.

After the blog contest finals, please vote for me: the Qt Quick image processing instance meitu xiuxiu (with source code download). Thank you. Other articles in the Qt on Android series are listed here:

    • Qt on Android: full process of Hello World
    • Introduction to Qt 5.2 for Android development in Windows
    • Analysis of the deployment process of Qt for Android
    • Qt on Android: Output Qt debugging information to logcat.
    • Qt on Android: Qt 5.3.0 released. Improvements for Android
    • Qt on Android Episode 1)
    • Qt on Android Episode 2)
    • Qt on Android Episode 3)
    • Qt on Android Episode 4)
    • Compiling a pure C project using Qt for Android
    • Compiling Android C language executable programs using Qt for Android in Windows
    • Qt on Android: Android SDK Installation
    • Qt on Android: http download and Json Parsing


How to Use Qt to write Android applications

I am also motivated to write this article. The following describes how to use Qt Creator to write Android applications. PS: before that, you should set up a Qt-Android environment. For more information, see my article: Step 1 of setting the qt-android development environment: create an Android Project. I will use the Empty Qt Project as an example. After you click Choose, a dialog box is displayed, asking you to enter the Project name and selection path. After the input is complete, click Next. The following is an important operation: Select Qt Version. Note that Destkop is selected by default, correct settings should be followed. Click Next to confirm the settings. If there is no error, click Finish to create the Qt-Android project. As long as the Qt project is correctly established, more than half of the projects have been completed. Step 2: Compile the program. In this step, you can write the program according to the common step of Qt Creator. However, note that some modules have not been transplanted yet, such as the Qt network module, So there cannot be network-related applications (but I think this will be transplanted sooner or later ). For example, I will use hello world: # include <QApplication # include <QLabelintmain (intargc, char ** argv) {QApplicationapp (argc, argv ); QLabel * label = newQLabel ("<palign = centerHello, World! </P "successfully label-show(projects ;returnapp.exe c ();} Step 3: Set the compilation option Projects tag-Run to expand Package deployments, select the Android target SDK, and expand the Deploy deployments following the steps below (for example, android7, select Deploy local qt libs and click the third green triangle button on the left side to run: Step 4: running the app you write on your mobile phone will package it into an apk and put it in/android/bin in your project folder. Copy it to your mobile phone to install it. However, the mobile phone cannot run this program. After all, the Android system does not have a Qt library. At this time, you need Ministro, a library required to download the Android system Qt program. You can search for Ministro in the electronic marketplace or download it from the Ministro project: Ministro. After installing Ministro, run the Qt program and download the required library as prompted.

Can android applications be developed using java on the QT platform? What is QT for Android?

First question
Can android applications be developed using java on the QT platform?
Currently, this is not acceptable!
Second question
What does QT for Android mean?
QT for Android is an SDK. Programmers familiar with Qt can use it and generate an APK that can be run directly on the android platform. However, it is not yet mature and is still being improved.

Related Article

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.