Meego Italian Day 2011 – Andrea Grandi - Qt: l’infrastruttura di programmazione multipiattaforma.
Panoramica di Qt: libreria multipiattaforma per lo sviluppo di programmi con interfaccia grafica tramite l’uso di widget. Perchè usarla? Quali sono i vantaggi? Che linguaggio di programmazione utilizza? E sotto che licenza viene rilasciata? Insomma, tutto quello che abbiamo sempre voluto sapere su Qt, ma non abbiamo mai osato chiedere. Inoltre qualche nozione teorica su Qt Quick e QML.
Andrea Grandi è studente di Informatica presso l’Università di Firenze e ha lavorato per qualche anno come sviluppatore di software. Dal 2007 fa parte della community di Maemo, in cui si impegna attivamente per aiutare i nuovi utenti, organizzare eventi e sviluppare applicazioni; recentemente è stato eletto membro del Maemo Community Council. Ha iniziato da alcuni anni a lavorare con Qt/C++ per creare programmi destinati ai dispositivi Maemo sino ad accumulare un’esperienza tale da essere nominato Nokia Qt Ambassador. Inoltre è socio fondatore del Pistoia Linux User Group.
http://www.meegoit.com/2011
2. Distribute: Ovi Store
... and get famous and rich!
Design, develop & test
Choose development technology
Qt, Web, Java
Select target platform(s)
MeeGo, Symbian, Series 40
Choose target market(s) for your app
Europe, US, Africa, China, India, etc.
7. Native apps
Use operating system and its functions directly
(different code for networking, GPS, etc.)
Operating System
Symbian, MeeGo, Windows, Mac OS, Linux
8. (if needed, direct access is still possible)
Your App
Qt framework
Same code works on all platforms,
covers many usecases (GPS, etc.)
Operating System
Symbian, MeeGo, Windows, Mac OS, Linux
9. Using Qt SDK for
– Dev. environment
– Testing
– Translation
Publish to
– Help
– Ovi Store
(Symbian, MeeGo)
Developer App Source Code – Windows
– Linux
Using Qt framework for – Mac
– User Interface – Embedded
– Networking
– Location (GPS)
– Web integration
– ...
10.
11. • Cross-Platform • Mobile focus
– Same source code for multiple platforms – Location, Maps
– Maximum performance – native apps! – Sensors
• Generic – Messaging (SMS, email)
– User Interface – Contacts, Calendar
– Declarative UI, animation, gestures, – Camera
multi-touch, 3D (OpenGL) – System information
– WebKit & JavaScript engine included – Haptics (vibration)
– Multimedia (audio, video) • Extend
– Networking, XML – Include any 3rd party C++ library / code
– SQL, files, app settings
– Container classes, object communication, 23 modules,
threading, unit testing ~ 800 classes,
~ 9000 functions
12. 4 million DL / day
190+ countries
Discussion boards, One-time fee of €1. 103x operator billing
e-learning videos, Submit an unlimited number of apps.
examples
SDK, toolchain,
remote device testing,
etc.
13. Open Source
qt.gitorious.org
Qt can be used in commercial,
closed-source apps
Changes to Qt source
must be shared
Tech support available
Included support
14.
15.
16. Nokia E71 Nokia N8
(S60 3.1, 2008) (Symbian^3, 2010)
• Qt for Symbian:
– Works on S60 3.1+ (E71, E72, 5800, N97, N8, etc.) *
– Look up platform versions:
http://www.forum.nokia.com/devices/
Qt Compatibility Qt Pre-Installed
* Qt can be installed on all compatible devices. Not all devices are enabled for Qt content in the Ovi Store. Current list of Ovi Store device deployment support for Qt apps:
http://www.forum.nokia.com/Distribute/Packaging_and_signing.xhtml
17. • Open Source Linux for Mobile Computers
– Based on Maemo and MobLin
– Developed by Nokia and Intel
– Hosted by the Linux Foundation
– www.meego.com
18.
19.
20. • Qt is the same on all platforms, but:
– New UI concepts for mobile devices
• Touch screen, limited screen space
– Be careful
• Network speed, roaming, battery
– More possibilities
• GPS, accelerometer, compass, haptics, multitouch
• Platform-specific knowledge
– Mainly hidden
– A few concepts shine through
• Security system (Symbian: capabilities, signing)
• Need to use native operating system APIs when Qt doesn’t provide the functionality
21. • You‘ll love Qt!
– Easier setup
• 1-click installation (Qt SDK)
– Hides complexity
• No descriptors, cleanup stack,
two-phase construction, active objects
– Less code, more efficiency Nokia 7650 (2001)
Nokia’s first Symbian phone
– Expand the reach
• Deploy your app not only to Symbian, but also to MeeGo and other platforms
22. • Expand your reach
– Reach different market segment
– Nokia: 30.8% global market share (Q4 2010, IDC)
• Porting
– Web: supported with all manufacturers
– Native apps: different programming languages
• Porting Guidelines
– http://wiki.forum.nokia.com/index.php/Porting_Mobile_Applications_to_Qt
23. • Keep your assets
– Reuse images, sound & music
• Screen resolution
iPhone <= 3 480 x 320 3:2
iPhone 4 960 x 640 3:2
Nexus S 800 x 480 5:3
Symbian^1 & 3 Samsung Galaxy S 800 x 480 5:3
640 x 360
16:9 aspect ratio Nokia N900 800 x 480 5:3
24. Engine: WebKit (latest version,
great HTML 5 support)
Dev. environment: Qt SDK - Storage of content on
the device (HTML, CSS,
JavaScript, Images)
- Menu icon
Engine: WebKit (earlier version, - Access to device features
same as phone browser)
Dev. environment: Aptana Studio / Nokia Web SDK
25. Rewriting your source code
is always required
Java (parts in C++ possible)
Native OpenGL ES 2.0 is
Eclipse
supported on all platforms,
but steep learning curve
and more effort!
C++
Qt SDK
Objective C
Xcode
26.
27. • Qt SDK 1.1 Maemo
– One-click installation
• IDE, toolchain, documentation,
examples Desktop Simulator
– Tech Preview out now: Qt SDK
works on
http://labs.qt.nokia.com/2011/01/20/qt-sdk- Windows, Linux,
1-1-technology-preview-released/ Mac
MeeGo
Symbian
(soon)
28. • Efficient Testing
– Quick launch
– Scripting possibilities
• Using JavaScript
– Simulate mobile environments
• Location, contacts, etc.
– Simulate phone events
• Battery, messages, etc.
– Skins for different platforms / form-factors
• Resolutions, orientation, etc.
29. • Widgets (QLabel, QPushButton, etc.)
– Use platform UI design
– Support style sheets
– Drag & drop UI designer
Great for desktop.
Static layouts make effects difficult.
Small UI, different interaction paradigms.
30. • Qt Quick
– QML language and JavaScript
– Declarative syntax, animations and states integrated
– Drag & drop UI designer
Very easy to make slick, fluid UIs.
Most important for mobile devices!
Ready-made UI components on their way *
* Project page: http://bugreports.qt.nokia.com/browse/QTCOMPONENTS
31. Desktop App Mobile App Game
Widgets
Qt Quick
OpenGL
Web
33. • Most cross-platform
– Design and create any custom user interface
– Same resolution: pixel precise on desktop, Symbian and MeeGo
Windows 7 Simulator
Maemo / MeeGo
Symbian^3
34. import Qt 4.7
Rectangle {
• Describe UI by tree structure of width: 200
height: 200
property bindings Image {
– Properties dynamically source: "QtLogo.png"
anchors.centerIn: parent
evaluated }
– Communication through }
signals & slots
– Bindings to C++ code possible
– Animate properties using
states and transitions
37. Viewer on PC & mobile: Qt C++ app to load and show QML
Testing 100% pure QML directly
Can include C++ for app logic
E.g., created by Flowella
38. • Simplify building rich UIs with Qt Quick
– Provides widgets for Qt Quick – title bar, actions,
list items, buttons, etc.
– Styles to integrate with native look & feel
• More Info
– Open source, in development
– General info:
http://labs.qt.nokia.com/2010/09/10/building-
the-future-reintroducing-the-qt-quick-
components/
39. Mobility 1.1 – develop now,
Mobility 1.0 – use now deploy to Ovi Store end of Q1 2011
Bearer Management API Camera
Contacts Document Gallery
Location Feedback
Messaging Landmarks
Multimedia Maps/Navigation
Publish and Subscribe Organizer
Service Framework Service Framework – Out of process
Sensors
System Information
Versit
40.
41. Qt Install
App
(& SI) Required Qt version
not already installed?
Download and install Qt
http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian
42. * Qt apps are native apps; therefore, the security model of the target operating system applies.
1. Determine the required security / privacy related features
– Most common: (See: wiki.forum.nokia.com/index.php/Capabilities )
Feature Capability
Internet access, telephony, messaging NetworkServices
Access location (GPS, etc.) Location
Camera, record audio UserEnvironment
Contacts, Calendar ReadUserData / WriteUserData
Bluetooth LocalServices
IMEI, model name, battery status ReadDeviceData
2. Define the capabilities in the Qt project file (.pro)
symbian:TARGET.CAPABILITY += Location ReadUserData
43. 3. Get the right certificate during development
44. 4. Publish
Need Certified Signed capabilities?
wiki.forum.nokia.com/index.php/Capabilities
-> Purchase a Publisher ID ($200 / year)
Submit to Certified Signed process @ www.symbiansigned.com
45. Windows Symbian MeeGo
Mac OS
Linux
N900 Tech Preview:
out now
* Remember: Qt 4.6 apps (= w/o Qt Quick) supported on the Ovi Store for Symbian since summer 2010!
49. Beginning Nokia Apps Development
Ray Rischpater, Daniel Zucker. Apress.
Complete end-to-end story of developing for Symbian and
MeeGo with Qt (Quick) and HTML 5.
Status: Qt 4.7, December 2010
Foundations of Qt Development
Johan Thelin. Apress.
More in-depth and technically oriented explanation of Qt – different approach to
many other books. Generic Qt, no mobile.
Status: 2007
C++ GUI Programming with Qt 4 (2nd edition)
Jasmin Blanchette, Mark Summerfield. Prentice Hall.
Official book for generic Qt development (no mobile). Good for looking things up or for enhancing your
knowledge, average for learning from scratch.
Status: Qt 4.3, 2008
50. • Official accreditation for individual developers
– Confirms your development skills in Qt
– Become more attractive in the job market!
– Qt Essentials exam: 50 multiple choice questions, 60 minutes
– Coming soon: Qt Advanced exams (widgets and C++)
51. • Active community member?
– Be even more involved, improve your network and get rewarded!
– Forum Nokia Champion
http://www.forum.nokia.com/Community/Champions/
– Qt Ambassador
http://qt.nokia.com/qt-in-use/ambassadors/qtambassador/
52. • Qt is a good way to teach software development
– Instant results to motivate attendees
– Graphical tools make entry easier
– Flexible system, extensible with own libraries
– … and still standard C++!
• University support
– Free Qt course materials under Creative Commons (PPT and OpenOffice)
http://qt.nokia.com/services-partners/qt-in-education/qt-in-education-course-material
– Forum Nokia University support
http://www.forum.nokia.com/Developer_Programs/Forum_Nokia_for_universities/
53. • Not happy with the way something works? Found a bug?
– Submit your Qt bug report or suggestion to:
http://bugreports.qt.nokia.com/
– Unsure about what to include? The guide is here:
http://developer.qt.nokia.com/wiki/ReportingBugsInQt
– Found a bug somewhere outside of Qt?
Report it here:
http://www.forum.nokia.com/Support/
– Also go to the above URL to buy a
commercial support ticket if needed!
54. Want to learn more?
www.forum.nokia.com/Qt
Andreas Jakl
Senior Technical Consultant
Forum Nokia