« | Blog Home | »

Qt Dev Days 2011, Day 2: Conference Sessions

Wed 11.30.11 – Here are my notes from the Qt Developer Days 2011 Day 2, the Conference Sessions of which there was many good & meaty sessions on Qt, Qt Quick, and mobile. The big dinner and party was also this evening, but that will merit a separate photo essay post.
My notes are mostly a transcription but sometimes a paraphrase of what the speaker said and what their slides said, if exact quote then I will put it in “”. The use of () is my notes or asides or thoughts.


Qt Dev Days 2011 Day 2
Wed 11.30.11
Targeting Android with Qt
Espen Riskedal @snowpong
Cutehacks.com
About Espen and Cutehacks makes apps
“Teach you how to publish Qt apps in the Android market” – Qt for Android is an open source project, “I am giving this talk to evangelism and inspire you.”
Qt on Mobile platforms
Espen focuses on platforms that matter, by matter he means the mobile platforms you can make money on.
52% of all smartphones in the world are Android devices, as of Q2 2011
Android details: 4 major releases, ARM & x86, Linux, Dalvik
Android API levels: need to keep in mind the API level, with each release there is a bump in API level
Espen recommends API level 7 (as of Q4 2011)
Bada is a bigger platform than Windows Phone right now.
Definition of smartphone is that you can install apps on it.
Qt has the ability to target more than 60+% of the smartphones in upcoming years between Nokia, Android, RIM, and iOS.
Necessitas is a community port of Qt for Android. To be upstreamed to Qt Project so that it will be a main stream part of Qt.
Installing Necessitas
OpenJDK (and Ant)
Necessitas 0.3 (3rd alpha)
http://bit.ly/qtand03
*Linux
*not root
Included components
Android SDK
Android NDK
Qt, QtWebKit, QtMobility
Qt Creator
et al
Getting a USB connection to connect an Android phone for testing
Espen is using Terminal for setting up USB connection, he says that a graphical tool is coming soon
Install Ministro / Ministro 2 – smart installer for Android to install Qt libraries.
Qt Quick demo
Qt Target Setup, Espen uses armv5 release.
(Espen is now doing a live demo on his Samsung Galaxy S2 and I am amused that his “Fly” app that he has ported to android is using the Fly Meego icon)
Added files explained
On Android the Qt app is not really an app but a library with a main function
Necessitas status
SDK (almost) complete for Win, Linux, and Mac (Linux is best right now)
Qt Creator: Deploy libraries and app, Run app, Debug app, signs the app
Porting an actual app
Nokia N9 & Nokia 700 -> Samsung Galaxy S2
Changes needed
Use the right QML file and showFullScreen()
Add app icons
set pkg name
set minSdkVersion
Publishing to Android Market – sometimes the easy part is writing the app and the hard part is getting it published.
Package is hte .APK format explained
* .jar and .zip
* Native apps also include libs/armeabi/
Two publishing options
Ministro 2 (smart installer) or Bundling Qt
Ministro has positive benefits of lower files size but the problem of one time UX with user needing to agree to install Ministro
Bundled Qt is much larger and there are quirks over https
Getting an Android Market account
Signing the APK
Can sign inside of Necessitas or can do it manually with terminal (Create key, sign package, and verify sig)
Actually publishing
market.android.com/publish
Conclusion:
Qt on mobile: Potentially bright future
Necessitas: out of the box with rough edges
Android Market: Quick and easy
(Espen keeps taking pot shots at the ‘next billion’ catch phrase. He says he has hope now about Qt with the ports to Android, he did not have hope last February.)
mailinglist for users:
google groups android-qt
wiki: sourceforge.net/p/necessitas/home/necessitas/
*********
Cross-Platform Mobile UIs
Riku Valtasola @rikuj
Futurice
Our team develops a lot of mobile apps & services for all relevant mobile platforms
Qt is currently the most used technology in our Futurice team
Futurice Qt mobile apps: WordPress, Tron Legacy, Nokia Trailers, Transformers, W2C Rally app,
General thoughts on Cross-platform Mobile UIs
Mobile porting: Does it even exist? Complete rewrite?
Better term: Migration
Rule 1: in real life, Rewrite is OK
Rule 2: If technology doesn’t work, don’t force it
Rule 3: Best User Experience will be always with the platform’s native frameworks
Rule 4: Prepare for challenge: screen size and navigation model
Rule 5: Designers and Engineers sit together (from the beginning)
Looking at the Futurice QtDD11 event schedule app
QML for Symbian, N9, N950
Mobile web for the other platforms (inc Android, iOS, Windows Phone)
Application Features
Detailed conf schedule with info on each session and speaker, updates fetched from server
QML UI using Qt Quick Components and custom UI components
Forming your own conf schedule by tagging fave sessions
Twitter and FB integration for sharing interesting sessions
Adding fave sessions to device calendar (Symbian)
Conf area maps, session locations
Session feedback forms
Riku gives a demo
Design Considerations
Symbian Belle v N9 design style
Extensive use of Qt Components
Mobile web for all other platforms – m.qtdevdays2011.qt.nokia.com
Example of Don’t Force Technology if it doesn’t work: Petabarf XML schema
Conference planning software was not flexible enough for our needs
Custom XML reusing some ideas from Pentabarf XML
(Jen says: could Pentabarf picked a more amusing name? Five barf.)
Riku shows diagram of the Futurice QtDD11 app stack
App Internals
Dev Challenges:
Twitter/FB – quite painful. using WebView for initial auth, on Symbian eats a lot of memory and UX is not great.
Text rendering on Symbian, esp vertical doesn’t look good, comparing to n9
No 34d party API for launching Maps app with desired address + WEb version of Nokia Maps does not work on Symbian devices?
we could not launch maps…
Relative Challenges
Ovi Store release times are not always fast enough for our release cycles
Harmattan packages are often published faster than Symbian
Currently, Ovi Store for Sym cannot accept Qt 4.7.4 builds although leatest Qt SDK 1.1.4 builds 4.7.4 by default
Harmattan UI Optimization
Buttons: defaults to 70% of screen width, don’t resize according to content like Sym
Solution: Use Toollcon…
Wide variety of eligible text sixes on Symbian and Harmattan. Solution: use custom sizes
ScollBar and SelectionListItem are missing, custom QML dialogs and components
UI Optimization
Very slow start up times with first view initializing Qt Components in Harmattan
Solution: Use Harmattan guidelines for splash screen at
Or make static splash QML as source for the QDeclarativeView then immediately launching a singleShot…
Using Git as Version Control
Keeping separate branches for different platforms
Merging as needed
Nokia Porting Support
developer.nokia.com/Develop/Porting
Qt API Mapping tool
************
Qt Networking – Web Services
Peter Hartmann, Nokia
What is the goal?
Give overview of web services in general
explain how to use these services with Qt
Web Services
Http protocol
who offers? google maps, twitter api, you tube, flickr, amazon, facebook, others
programmableweb.com
who uses a web service?
Mobile hybrid apps, desktop apps, with tablets line between the two is blurring
websites – bbc web maps
How is data exchnaged?
REST v. SOAP
REST – used by FB & Twitter, use http get & post with urls to identify
SOAP – always uses http post with xml
There is a Qt SOAP solution.
Peter will focus on REST.
REST Data:
Authenication data: http basic over SSL, OAuth, other methods
Payload data: JSON, XML, other (e.g. binary)
Web Services with Qt
HTTP
authentication
data formats
HTTP with Qt and C++
QNetworkRequest: requires url
QNetworkAccessManager: get() post() put()
QNetworkReply: uploadProgress(), readyRead(), finished()
For QML use XMLHttpRequest: open() send() onreadystatechange reponseText – can send JSON as well as XML
Authentication:
Http Basic is supported by QNetworkAccessManager
OAuth: OAuth 1.0a: supported by 3rd party modules (like KQOAuth) OAuth2: can be done on top of QNetworkAccessManager
Services using OAuth 1: Twitter, Dropbox, flickr
OAuth 2: FB, Foursquare, YouTube, et al
OAuth2:
1. to FB: get app ID
2. from FB:send app ID
3. user: app displays login screen with app ID (in browser/WebView)
4. to FB: login and grant the app access
5. from FB: send access token
6: to FB: make callsi to API with access token
Data Formats:
How do you parse JSON in Qt?
in C++: 3rd party parsers qjsonparser, QJson, etc
in QML: JSON.parse()
Don’t use eval to parse JSON in QML
XML:
in C++: XPath: QXmlQuery, DOM: QDomDocument, QXmlStreamReader – faster if parsing a lot of XML, SAX: QXmlSimpleREader
in QML: XmlListModel
Parse images
in C++: binary – QImage
in QML: Image
Example:
WebView showing a map and tweets
How does this work: app displaying Ovi Maps page then asks Twitter to send tweets from the area in the map
*********
Deep Dive into Meego
Yoann Lopes
Introduction
N9 is a great device to learn to code a mobile app, if you build your Qt competence on the N9 there is a future for it in Qt.
MeeSpot – Spotify client
What are your options?
* Qt Quick with Components
* Meego Touch
* QWidget
* QtWebKit
* OpenGL ES 1.1/2.0
Native Style with QtQuick
Theme icons can be used by calling the icons in the N9’s common
tools: commonTools
Image {
…..
source: “image://theme/icon-l-accuweather”
}
Inverted Theme
Component.onCompleted {
theme.inverted = true;
theme.colorScheme = “purple1”
}
Developing for Harmattan
Optimizing Application Startup
* invoker program
* Automatic screen orientation
Page {
orientationLock: PageOrientation.Automatic //Default
}
Data Storage
*GConf or QSettings for application settings
*QDesktopServices::storageLocation()
– QDesktopServices::DocumentsLocation
– QDesktopServices::TempLocation
– QDesktopServices::CacheLocation
etc
Optimizing Power Consumption
* Avoid unnecessary activities in minimized state
– No UI updates
– No data updates
– Free resources
* Use System Heartbeat API for periodic updates
Resource Policy Framework
* Make your app live in harmony with its environment
* React to device mode changes
* Get sufficient system resources (scheduling priority, memory)
Resources: Audio, playback, lock button, backlight, etc.
Resource Class: Call, alarm, game, player, etc.
Control Group: Telephony, camera, gaming
Home Screen Event Feed
* Events Feed API
Packaging
* Make your own icon
* Edit the .desktop file
* Add package description to the control file
* Add copyright