Your SlideShare is downloading. ×
0
Targeting Android with Qt Espen Riskedal / cutehacks.com          @snowpong
Introduction        About me,    and about the talk.
About me●    Trolltech and Nokia●    Symbian and Windows CE●    Co-founded cutehacks.com         Espen Riskedal           ...
We make apps
Purpose of this talk“Teach you how to publish Qt apps in the Android market”      I have a vested interest.
Agenda●    Introduction●    Qt on mobile platforms●    Necessitas●    Publishing to Android Market●    Conclusion
2.3.x “Gingerbread”         ●           Google Nexus S         ●           December 2010         ●           Linux kernel ...
Qt on mobile platformsA brief introduction on whichmobile platforms you can targetwith Qt.
Todays mobile platforms
Supported by Qt
Almost supported by Qt
Some Android details●    4 major releases●    ARM and x86●    Linux●    Dalvik
Well known modelsGalaxy S2    Tab 10.1     Xperia Play
Android API levelsPlatform version      API Level VERSION_CODE...                   ...     ...Android 2.3 – 2.3.2   9    ...
Android platform distribution http://developer.android.com/resources/dashboard/platform-versions.html
A possible future for Qt
Photo: flickr.com/quinnanya/ CC / Some rights reserved                               1.6 “Donut”                          ...
NecessitasNecessitas is a community portof Qt for Android. Its founderand main developer is BogDanVatra.
Installing Necessitas●    OpenJDK (and Ant)●    Necessitas 0.3 (3rd alpha)                    http://bit.ly/qtand03     ● ...
Default values are OK
Included componentsAndroid SDKAndroid NDKQt, QtWebKit, QtMobilityQt Creatorgdb / gdbserverAntJDK
Adding an emulator
Getting a USB connection●    Enable USB debugging    ●        Settings->Applications->Development●    Check connection    ...
Install Ministro / Ministro 2
A “Hello Qt Quick” example●    Qt Quick Project → Qt Quick Application     ●         Name     ●         Target (Android / ...
Lets do it for real
Our “funky” main.qmlimport QtQuick 1.0Rectangle {    anchors.fill: parent    gradient: Gradient {       GradientStop { pos...
Psychedelic bouncy ball
Added files explainedIn addition to the .pro and .h/.cpp files:android/AndroidManifest.xmlandroid/build.xmlandroid/res/*an...
How does it really work?
Necessitas status●    SDK (almost) complete for     ●         Windows, Linux and Mac●    Qt Creator     ●         Deploy l...
Popularity of Necessitas●    ~10000 downloads of 0.2.1 (2nd alpha)●    ~3200 downloads of 0.3 so far (3rd alpha)●    ~5000...
Necessitas roadmap●  Alpha3 (just released!)    ●      Lots of fixes    ●      Signing for Android Market    ●      OpenGL...
Porting an actual appNokia N9 / Nokia 700                       Samsung Galaxy S2
Changes needed●    Use the right QML file and showFullScreen()●    Hack around font issue●    Add app icons●    Set packag...
QML and showFullScr...--- a/main.cpp+++ b/main.cpp@@ -50,14 +56,16 @@ int main(int argc, char *argv[])-#elif defined (Q_OS...
Font hack--- a/main.cpp+++ b/main.cpp@@ -29,6 +29,12 @@ int main(int argc, char *argv[])    application.setOrganizationDom...
Setting app iconscommit a91fa2461ced0e75270b71c41ee80309e0697777Author: Espen Riskedal <espen@cutehacks.com>Date:   Sun Oc...
Setting package name--- a/android/AndroidManifest.xml+++ b/android/AndroidManifest.xml@@ -1,5 +1,5 @@<?xml version=1.0 enc...
Setting minSdkVersion--- a/android/AndroidManifest.xml+++ b/android/AndroidManifest.xml@@ -14,4 +14,5 @@    <supports-scre...
3.x “Honeycomb” ●   Motorola Xoom ●   February 2011 ●   Linux kernel 2.6.36                         Photo: flickr.com/quin...
Publishing to Android MarketSometimes the easy part iswriting the app. The hard part isgetting it published.
.APK format explained●  .JAR and .ZIP●  Typically includes:      META-INF/      res/      AndroidManifest.xml      classes...
Two publishing optionsMinistro              Bundling Qt+ dev friendly        + UX+ updates             + BIC+ multiple arc...
Bundling Qt with your appTarget one arch (ARMv5)Set relatively high API levelOnly include the actually needed libsDisable ...
Publishing with Ministro            cd android/            ant releaseThis produces Fly-unsigned.apk in the        shadowb...
Getting an A.M. account  http://market.android.com/publish              Youll need:      A credit card with 25USD         ...
Name, email and phone
Paying
Credit-card needed
One time fee of 25USD
Order sent
Distribution agreement
We can publish free apps!
Sign up for merchant
We can make money!
Signing the .APKCreate keykeytool -genkey -v -keystore cutehacks-release-key.keystore -alias cutehackskeystore-keyalg RSA ...
Verifying the signatureVerify signaturejarsigner -verify -verbose Fly-unsigned.apk           585 Tue ... META-INF/MANIFEST...
Actually publishing  http://market.android.com/publish              Youll need:      Signed APK (max 50MB)    High-res app...
Upload .APK
Set name and screenshots
In the store
Installation UX with MinistroPress app            Press “FREE”                           Press “OK”
Installation UX with MinistroPress app            Press “Yes”                          Press “Ministro”
Installation UX with MinistroPress “Install”                  Press “Accept”                                   Press “Yes”
Installation UX with Ministro
2.0/2.1 “Eclair”                                ●                                  Motorola Droid                         ...
ConclusionLets summarize and look at the           future.
SummaryQt on mobile: Potential bright futureNecessitas: Out-of-the-box with rough edgesAndroid Market: Quick and easy
Qts futureQt 5 – Qt Quick and scenegraph“The next billion”iOS and BBXOpen Governance
Information on NecessitasMailinglist for users:http://groups.google.com/group/android-qtMailinglist for devs/contributors:...
Its already possible        Fly in                                               Fly installed    Android Market          ...
Questions?       Thank you!     @snowpong (Twitter)
Upcoming SlideShare
Loading in...5
×

Targeting Android with Qt

39,429

Published on

Explains how to install Necessitas (Qt for Android), how to use it, and how to publish to the Android Market. Based on Necessitas 0.3 (3rd alpha)

Slides are from Qt Developer Days 2011 in San Fransisco

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
No Downloads
Views
Total Views
39,429
On Slideshare
0
From Embeds
0
Number of Embeds
31
Actions
Shares
0
Downloads
232
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide
  • First released in Septemper 2008 together with HTC Dream phone
  • First released in Septemper 2008 together with HTC Dream phone
  • First released in Septemper 2008 together with HTC Dream phone
  • Transcript of "Targeting Android with Qt"

    1. 1. Targeting Android with Qt Espen Riskedal / cutehacks.com @snowpong
    2. 2. Introduction About me, and about the talk.
    3. 3. About me● Trolltech and Nokia● Symbian and Windows CE● Co-founded cutehacks.com Espen Riskedal @snowpong● Still believe in Qt Everywhere
    4. 4. We make apps
    5. 5. Purpose of this talk“Teach you how to publish Qt apps in the Android market” I have a vested interest.
    6. 6. Agenda● Introduction● Qt on mobile platforms● Necessitas● Publishing to Android Market● Conclusion
    7. 7. 2.3.x “Gingerbread” ● Google Nexus S ● December 2010 ● Linux kernel 2.6.35Photo: flickr.com/quinnanya/ CC / Some rights reserved
    8. 8. Qt on mobile platformsA brief introduction on whichmobile platforms you can targetwith Qt.
    9. 9. Todays mobile platforms
    10. 10. Supported by Qt
    11. 11. Almost supported by Qt
    12. 12. Some Android details● 4 major releases● ARM and x86● Linux● Dalvik
    13. 13. Well known modelsGalaxy S2 Tab 10.1 Xperia Play
    14. 14. Android API levelsPlatform version API Level VERSION_CODE... ... ...Android 2.3 – 2.3.2 9 GINGERBREAD... ... ...Android 2.1.x 7 ECLAIR_MR... ... ...Android 1.5 3 CUPCAKE... ... ...
    15. 15. Android platform distribution http://developer.android.com/resources/dashboard/platform-versions.html
    16. 16. A possible future for Qt
    17. 17. Photo: flickr.com/quinnanya/ CC / Some rights reserved 1.6 “Donut” ● Acer Liquid A1 ● September 2009 ● Linux kernel 2.6.29
    18. 18. NecessitasNecessitas is a community portof Qt for Android. Its founderand main developer is BogDanVatra.
    19. 19. Installing Necessitas● OpenJDK (and Ant)● Necessitas 0.3 (3rd alpha) http://bit.ly/qtand03 ● Linux ● not root
    20. 20. Default values are OK
    21. 21. Included componentsAndroid SDKAndroid NDKQt, QtWebKit, QtMobilityQt Creatorgdb / gdbserverAntJDK
    22. 22. Adding an emulator
    23. 23. Getting a USB connection● Enable USB debugging ● Settings->Applications->Development● Check connection cd android-sdk/platform-tools ./adb devices 304D1...6203B05E device ???????????????? no permissions● Restart if needed sudo ./adb kill-server sudo ./adb devices
    24. 24. Install Ministro / Ministro 2
    25. 25. A “Hello Qt Quick” example● Qt Quick Project → Qt Quick Application ● Name ● Target (Android / armv5) ● Next/Next/Next● Add QtDeclarative● Press Ctrl-R
    26. 26. Lets do it for real
    27. 27. Our “funky” main.qmlimport QtQuick 1.0Rectangle { anchors.fill: parent gradient: Gradient { GradientStop { position: 0.0; color: "red" } GradientStop { position: 0.33; color: "yellow" } GradientStop { position: 1.0; color: "green" } } Rectangle { id:ball; width:100; height:100; radius: 50 color:"black" Behavior on x { PropertyAnimation{ duration:500; easing.type: Easing.OutBounce} } Behavior on y { PropertyAnimation{ duration:500; easing.type: Easing.OutBounce} } } MouseArea { anchors.fill: parent onClicked: { ball.x=mouse.x ball.y=mouse.y } }}
    28. 28. Psychedelic bouncy ball
    29. 29. Added files explainedIn addition to the .pro and .h/.cpp files:android/AndroidManifest.xmlandroid/build.xmlandroid/res/*android/src/.../ministro/*android/src/.../origo/Qt*
    30. 30. How does it really work?
    31. 31. Necessitas status● SDK (almost) complete for ● Windows, Linux and Mac● Qt Creator ● Deploy libraries and app ● Run app ● Debug app ● Signs the app
    32. 32. Popularity of Necessitas● ~10000 downloads of 0.2.1 (2nd alpha)● ~3200 downloads of 0.3 so far (3rd alpha)● ~5000 views of my Münich slides
    33. 33. Necessitas roadmap● Alpha3 (just released!) ● Lots of fixes ● Signing for Android Market ● OpenGL etc. ● ...● Alpha4 ● Android Style ● Menu integration ● ...● Beta ● Refactor Java wrapper code ● Promise BIC ● …?
    34. 34. Porting an actual appNokia N9 / Nokia 700 Samsung Galaxy S2
    35. 35. Changes needed● Use the right QML file and showFullScreen()● Hack around font issue● Add app icons● Set package name● Set minSdkVersion
    36. 36. QML and showFullScr...--- a/main.cpp+++ b/main.cpp@@ -50,14 +56,16 @@ int main(int argc, char *argv[])-#elif defined (Q_OS_SYMBIAN)+#elif defined (Q_OS_ANDROID) || defined(Q_OS_SYMBIAN) view.setSource(QUrl("qrc:/qml/Main.qml")); view.showFullScreen();#else
    37. 37. Font hack--- a/main.cpp+++ b/main.cpp@@ -29,6 +29,12 @@ int main(int argc, char *argv[]) application.setOrganizationDomain("cutehacks.com"); application.setOrganizationName("Cutehacks");+#if defined(Q_OS_ANDROID)+ QFont boldFont = application.font();+ boldFont.setBold(true);+ application.setFont(boldFont);+#endif
    38. 38. Setting app iconscommit a91fa2461ced0e75270b71c41ee80309e0697777Author: Espen Riskedal <espen@cutehacks.com>Date: Sun Oct 9 22:17:31 2011 +0200 added proper icons where it countsandroid/res/drawable-hdpi/icon.pngandroid/res/drawable-ldpi/icon.pngandroid/res/drawable-mdpi/icon.png
    39. 39. Setting package name--- a/android/AndroidManifest.xml+++ b/android/AndroidManifest.xml@@ -1,5 +1,5 @@<?xml version=1.0 encoding=utf-8?>-<manifest package="eu.licentia.necessitas...+<manifest package="com.cutehacks.fly" ...
    40. 40. Setting minSdkVersion--- a/android/AndroidManifest.xml+++ b/android/AndroidManifest.xml@@ -14,4 +14,5 @@ <supports-screens android:largeScreens="t... <uses-permission android:name="android.pe... <uses-permission android:name="android.pe...+ <uses-sdk android:minSdkVersion="7"/></manifest>
    41. 41. 3.x “Honeycomb” ● Motorola Xoom ● February 2011 ● Linux kernel 2.6.36 Photo: flickr.com/quinnanya/ CC / Some rights reserved
    42. 42. Publishing to Android MarketSometimes the easy part iswriting the app. The hard part isgetting it published.
    43. 43. .APK format explained● .JAR and .ZIP● Typically includes: META-INF/ res/ AndroidManifest.xml classes.dex resources.arsc● Native apps also include: libs/armeabi/
    44. 44. Two publishing optionsMinistro Bundling Qt+ dev friendly + UX+ updates + BIC+ multiple archs + custom fixes+ space / bandwidth - space / bandwidth- UX - less archs- updates - no updates- BIC
    45. 45. Bundling Qt with your appTarget one arch (ARMv5)Set relatively high API levelOnly include the actually needed libsDisable Ministro dependenciesBeware of SSL certsHere be dragons :-)
    46. 46. Publishing with Ministro cd android/ ant releaseThis produces Fly-unsigned.apk in the shadowbuild directory.
    47. 47. Getting an A.M. account http://market.android.com/publish Youll need: A credit card with 25USD A phone number
    48. 48. Name, email and phone
    49. 49. Paying
    50. 50. Credit-card needed
    51. 51. One time fee of 25USD
    52. 52. Order sent
    53. 53. Distribution agreement
    54. 54. We can publish free apps!
    55. 55. Sign up for merchant
    56. 56. We can make money!
    57. 57. Signing the .APKCreate keykeytool -genkey -v -keystore cutehacks-release-key.keystore -alias cutehackskeystore-keyalg RSA -keysize 2048 -validity 10000Sign packagejarsigner -verbose -keystore cutehacks-release-key.keystore android/bin/Fly-unsigned.apk cutehackskeystore
    58. 58. Verifying the signatureVerify signaturejarsigner -verify -verbose Fly-unsigned.apk 585 Tue ... META-INF/MANIFEST.MF 706 Tue ... META-INF/CUTEHACK.SF 1327 Tue ... META-INF/CUTEHACK.RSAsm 2932 Tue ... AndroidManifest.xmlsm 1500 Tue ... resources.arscsm 3064 Tue ... res/drawable-hdpi/icon.pngsm 1543 Tue ... res/drawable-ldpi/icon.pngsm 2347 Tue ... res/drawable-mdpi/icon.pngsm 86680 Tue ... classes.dexsm 164020 Tue ... lib/armeabi/libfly.so s = signature was verified m = entry is listed in manifestRename Fly-unsigned.apk to Fly-release.apk
    59. 59. Actually publishing http://market.android.com/publish Youll need: Signed APK (max 50MB) High-res app icon (512x512) Two screenshots (min 320x480) Title & Description
    60. 60. Upload .APK
    61. 61. Set name and screenshots
    62. 62. In the store
    63. 63. Installation UX with MinistroPress app Press “FREE” Press “OK”
    64. 64. Installation UX with MinistroPress app Press “Yes” Press “Ministro”
    65. 65. Installation UX with MinistroPress “Install” Press “Accept” Press “Yes”
    66. 66. Installation UX with Ministro
    67. 67. 2.0/2.1 “Eclair” ● Motorola Droid ● October 2009 ● Linux kernel 2.6.29Photo: flickr.com/quinnanya/ CC / Some rights reserved
    68. 68. ConclusionLets summarize and look at the future.
    69. 69. SummaryQt on mobile: Potential bright futureNecessitas: Out-of-the-box with rough edgesAndroid Market: Quick and easy
    70. 70. Qts futureQt 5 – Qt Quick and scenegraph“The next billion”iOS and BBXOpen Governance
    71. 71. Information on NecessitasMailinglist for users:http://groups.google.com/group/android-qtMailinglist for devs/contributors:https://mail.kde.org/mailman/listinfo/necessitas-develRepositories:http://community.kde.org/Necessitas/RepositoriesWiki:http://sourceforge.net/p/necessitas/home/necessitas/
    72. 72. Its already possible Fly in Fly installed Android Market on phone http://bit.ly/cutefly https://market.android.com/details?id=com.cutehacks.fly
    73. 73. Questions? Thank you! @snowpong (Twitter)
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×