今天QT5.2的beta版出來了,從其描述文檔來看,支持了android,特地下來試試。
New Modules and Nice Goodies
Some of the main new features of Qt 5.2include:
Qt Bluetooth: supported on Linux with Bluez4.x and Blackberry
Qt NFC: supported on Blackberry
Qt Positioning: supported on all platformsusing NMEA data, and using GeoClue on Linux
Qt Windows Extras: Integrate with nativecode on Windows
Qt Mac Extras: Integrate with native codeon Mac OS X
Qt Android Extras: Integrate with nativecode on Android
Improved time zone and locale support withQTimeZone and QCollator
Enhancements to multiple Qt Widgets and anew one, the QKeySequenceEdit class
Animations for QML that can not be blockedby high loads on the main thread
Some new features and mobile specificcontrols for Qt Quick Controls
Accessibility is now fully supported on alldesktop platforms and basic support on Android.
For a more detailed list of all newfeatures in Qt 5.2 please have a look at the New Features page in the QtProject wiki.
下載安裝Qt5.2
http://download.qt-project.org/development_releases/qt/5.2/5.2.0-beta1/
下載安裝android SDK
http://developer.android.com/sdk/index.html
下載安裝 android NDK
http://developer.android.com/tools/sdk/ndk/index.html
下載安裝 apache ant
下載安裝JDK
http://www.oracle.com/technetwork/java/javase/downloads/index.html
打開Qt Creator,選擇工具-選項-android,配置好剛剛安裝的文件路徑,並點擊【啓動android AVD管理器】
點擊 New 新建一個android模擬器,根據自己需要選擇Device
點擊ok,並選擇剛剛建立的設備,點擊Start啓動,此過程比較慢,耐心等待。
重啓Qt Creator 已經可以看到有設備了,我們檢查構建和運行中構建套件和Qt版本是否正確,確認無誤接下來就可以建立工程
新建一個Qt gui項目,選擇android for arm
或者將以前的工程修改爲android的工程:
項目->添加構建套件->選擇合適的編譯工具
編譯完成之後,點擊運行,選擇剛剛建立好的avd,等待許久,就可以在模擬器中看到程序的運行效果(非常漫長的等待)。