"Qt for Android" first Android app

Source: Internet
Author: User

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

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.