1) First you need to download Qt for Android version of Qt SDK on the official website
2) Download the Android-related SDK, do not look for, in the Qt Creator tool options Android configuration has the corresponding download link address.
3) after downloading the Android SDK, specify the appropriate SDK directory in the configuration screen above, then add Android kits in "Build & Run" .
4) after writing the QT code, click "Run" and in the list of pop-up Android devices, select the program to install the running Android device. (The first one is my Xiaomi 1S, the second one is the Android emulator)
How do I debug a run in a real machine? Connect the phone with a USB plug-in to the computer, usually automatically install the USB drive, and then refresh the device list, then you can. If this still occurs, try the following steps:1. Enter in the command lineAndroid SDK Tools Directory
2 command line input "adb kill-server"
3 command line input "adb start-server"
4 If the error message does not appear during the startup of ADB server, the ADB is successful!
then refresh the list of devices and your Android device will appear. I don't know if your device hasn't come up yet.
5) after selecting the target Android device, run the program and the program will be automatically compiled and deployed to your device. Install and run on your phone like a normal Android app. Note: If your program is already installed, please uninstall it first. Here's how to run:
here is the relevant code:
Sets the full-screen display in the constructor of the dialog box. Dialog::D ialog (Qwidget *parent): qdialog (Parent), UI (new UI::D ialog) { ui->setupui (this); Showfullscreen ();} The gray translucent background is set in the Redraw event of the dialog, but the actual run only sees the gray, not the transparent effect, but wirelessly each program to monopolize the entire screen, the background transparency is not very useful. void Dialog::p aintevent (qpaintevent *e) { q_unused (e) qpainter painter (this); Painter.fillrect (Rect (), Qcolor (130, 130, 130, 180)); button click event Handling to pop up a message box. void dialog::on_pushbutton_clicked () { qmessagebox::information (this, TR ("message"), tr ("I Love you! \n\t Xiao Hui "));}
"Qt for Android" first Android app