[Qt for Android] The first android program, Android android
1)First, you need to download the Qt SDK for Qt for android from the official website.
2)Download android-related sdks. You do not need to find them. The corresponding download link is available in the Android configuration of the Qt Creator tool option.
3)After downloading the Android SDK, specify the corresponding SDK directory in the configuration interface above, and then add the Android Kits in "Build & Run ".
4)After compiling the Qt code, click "Run". In the pop-up list of Android devices, select the Android device to which the program will be installed. (The first is my Xiaomi 1 S, and the second is the Android simulator)
How can I debug the test run on a real machine? Connect your phone to your computer by using USB. Generally, the USB driver is automatically installed and the device list is refreshed. If this still appears, try the following steps: 1. Go to the Android SDK tools directory through the command line
2. Enter "adb kill-server" in the command line"
3. Enter "adb start-server" in the command line"
4. If no error message is displayed during adb server startup, the adb is successfully started!
Then refresh the device list and your Android device will appear. If your device does not appear in this way, I don't know.
5)Select the target Android device and run the program. The program is automatically compiled and deployed on your device. Install and run your mobile phone just like an Android app. Note: If your program has been installed, uninstall it first. Run the following command:
The following code is used:
// Set full screen display in the constructor of the dialog box. Dialog: Dialog (QWidget * parent): QDialog (parent), ui (new Ui: Dialog) {ui-> setupUi (this); showFullScreen ();} // set a gray translucent background in the re-painting event of the dialog box, but only the gray background is displayed in actual running, but the transparent effect is not displayed. However, each program in Android occupies the entire screen exclusively, the background is transparent and is not widely used. Void Dialog: paintEvent (QPaintEvent * e) {Q_UNUSED (e) QPainter painter (this); painter. fillRect (rect (), QColor (130,130,130,180);} // click the event processing button to bring up a message box. Void Dialog: on_pushButton_clicked () {QMessageBox: information (this, tr ("message"), tr ("I love you! \ N \ t xiao hui "));}
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.
Can I use QT to write c ++ programs on Android phones?
Yes. Qt supports Android, but it is very difficult because there are too few researchers.