meego italian day 2011 – andrea grandi

54
08 February, 2011 Andreas Jakl Senior Technical Consultant Forum Nokia v3.0.2

Upload: francesco-baldassarri

Post on 12-May-2015

1.159 views

Category:

Technology


1 download

DESCRIPTION

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

TRANSCRIPT

Page 1: Meego Italian Day 2011 – Andrea Grandi

08 February, 2011

Andreas JaklSenior Technical Consultant

Forum Nokia

v3.0.2

Page 2: Meego Italian Day 2011 – Andrea Grandi

Choose target market(s) for your appEurope, US, Africa, China, India, etc.

Select target platform(s)MeeGo, Symbian, Series 40

Choose development technologyQt, Web, Java

Design, develop & test

Distribute: Ovi Store... and get famous and rich!

Page 3: Meego Italian Day 2011 – Andrea Grandi

Native apps (Qt)

Web Apps Web Apps

Java apps

Page 4: Meego Italian Day 2011 – Andrea Grandi
Page 5: Meego Italian Day 2011 – Andrea Grandi
Page 6: Meego Italian Day 2011 – Andrea Grandi
Page 7: Meego Italian Day 2011 – Andrea Grandi

Operating SystemSymbian, MeeGo, Windows, Mac OS, Linux

Native appsUse operating system and its functions directly

(different code for networking, GPS, etc.)

Page 8: Meego Italian Day 2011 – Andrea Grandi

Operating SystemSymbian, MeeGo, Windows, Mac OS, Linux

Qt frameworkSame code works on all platforms,covers many usecases (GPS, etc.)

(if needed, direct access is still possible)Your App

Page 9: Meego Italian Day 2011 – Andrea Grandi

Developer

Publish to – Ovi Store

(Symbian, MeeGo)– Windows– Linux– Mac– Embedded

App Source Code

Using Qt SDK for– Dev. environment– Testing– Translation– Help

Using Qt framework for– User Interface– Networking– Location (GPS)– Web integration– ...

Page 10: Meego Italian Day 2011 – Andrea Grandi
Page 11: Meego Italian Day 2011 – Andrea Grandi

• Cross-Platform

– Same source code for multiple platforms

– Maximum performance – native apps!

• Generic

– User Interface

– Declarative UI, animation, gestures,

multi-touch, 3D (OpenGL)

– WebKit & JavaScript engine included

– Multimedia (audio, video)

– Networking, XML

– SQL, files, app settings

– Container classes, object communication,

threading, unit testing

• Mobile focus

– Location, Maps

– Sensors

– Messaging (SMS, email)

– Contacts, Calendar

– Camera

– System information

– Haptics (vibration)

• Extend

– Include any 3rd party C++ library / code

23 modules, ~ 800 classes,

~ 9000 functions

Page 12: Meego Italian Day 2011 – Andrea Grandi

SDK, toolchain, remote device testing, etc.

Discussion boards,e-learning videos,

examples

4 million DL / day190+ countries

103x operator billingOne-time fee of €1.Submit an unlimited number of apps.

Page 13: Meego Italian Day 2011 – Andrea Grandi

Open Sourceqt.gitorious.org

Qt can be used in commercial,closed-source apps

Changes to Qt sourcemust be shared

Included support

Tech support available

Page 14: Meego Italian Day 2011 – Andrea Grandi
Page 15: Meego Italian Day 2011 – Andrea Grandi
Page 16: Meego Italian Day 2011 – Andrea Grandi

• 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

Nokia E71(S60 3.1, 2008)

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

Nokia N8(Symbian^3, 2010)

Page 17: Meego Italian Day 2011 – Andrea Grandi

• Open Source Linux for Mobile Computers

– Based on Maemo and MobLin

– Developed by Nokia and Intel

– Hosted by the Linux Foundation

– www.meego.com

Page 18: Meego Italian Day 2011 – Andrea Grandi
Page 19: Meego Italian Day 2011 – Andrea Grandi
Page 20: Meego Italian Day 2011 – Andrea Grandi

• 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

Page 21: Meego Italian Day 2011 – Andrea Grandi

• 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

– Expand the reach

• Deploy your app not only to Symbian, but also to MeeGo and other platforms

Nokia 7650 (2001)Nokia’s first Symbian phone

Page 22: Meego Italian Day 2011 – Andrea Grandi

• 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

Page 23: Meego Italian Day 2011 – Andrea Grandi

• Keep your assets

– Reuse images, sound & music

• Screen resolution

Symbian^1 & 3640 x 360

16:9 aspect ratio

iPhone <= 3 480 x 320 3:2

iPhone 4 960 x 640 3:2

Nexus S 800 x 480 5:3

Samsung Galaxy S 800 x 480 5:3

Nokia N900 800 x 480 5:3

Page 24: Meego Italian Day 2011 – Andrea Grandi

Engine: WebKit (latest version, great HTML 5 support)Dev. environment: Qt SDK

Engine: WebKit (earlier version, same as phone browser)Dev. environment: Aptana Studio / Nokia Web SDK

- Storage of content on the device (HTML, CSS, JavaScript, Images)- Menu icon- Access to device features

Page 25: Meego Italian Day 2011 – Andrea Grandi

Java (parts in C++ possible)Eclipse

Objective CXcode

C++Qt SDK

Rewriting your source code is always required

Native OpenGL ES 2.0 is supported on all platforms, but steep learning curve and more effort!

Page 26: Meego Italian Day 2011 – Andrea Grandi
Page 28: Meego Italian Day 2011 – Andrea Grandi

• 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.

Page 29: Meego Italian Day 2011 – Andrea Grandi

• 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.

Page 30: Meego Italian Day 2011 – Andrea Grandi

• 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

Page 31: Meego Italian Day 2011 – Andrea Grandi

Widgets

Qt Quick

OpenGL

Web

Desktop App Mobile App Game

Page 32: Meego Italian Day 2011 – Andrea Grandi

#include <QApplication>

#include <QPushLabel>

int main(int argc, char *argv[])

{

QApplication app(argc, argv);

QLabel helloLabel("Hello World");

helloLabel.setAlignment(Qt::AlignCenter);

helloLabel.showMaximized();

return app.exec();

}

import Qt 4.7

Rectangle {

width: 360

height: 360

Text {

anchors.centerIn: parent

text: "Hello World"

}

}

~ 300 lines of code,

~ 15 files

Page 33: Meego Italian Day 2011 – Andrea Grandi

• Most cross-platform

– Design and create any custom user interface

– Same resolution: pixel precise on desktop, Symbian and MeeGo

Windows 7

Symbian^3

Simulator

Maemo / MeeGo

Page 34: Meego Italian Day 2011 – Andrea Grandi

• Describe UI by tree structure of

property bindings

– Properties dynamically

evaluated

– Communication through

signals & slots

– Bindings to C++ code possible

– Animate properties using

states and transitions

import Qt 4.7Rectangle {

width: 200height: 200Image {

source: "QtLogo.png"anchors.centerIn: parent

} }

Page 35: Meego Italian Day 2011 – Andrea Grandi

• Interactivity

– Interact with

mouse / touch

– Execute JavaScript in signal

handlers

import Qt 4.7Rectangle {

width: 200height: 200Image {

source: "QtLogo.png"anchors.centerIn: parent

} MouseArea {

anchors.fill: parentonClicked: parent.color = "green"

} }

Page 36: Meego Italian Day 2011 – Andrea Grandi

• Dynamic property update

– Move image with mouse

import Qt 4.7Rectangle {

width: 200height: 200Image {

source: "QtLogo.png"x: myMouse.mouseXy: myMouse.mouseY

} MouseArea {

id: myMousehoverEnabled: trueanchors.fill: parentonClicked: parent.color = "green"

} }

Page 37: Meego Italian Day 2011 – Andrea Grandi

Viewer on PC & mobile: Testing 100% pure QML directly

E.g., created by Flowella

Qt C++ app to load and show QML

Can include C++ for app logic

Page 38: Meego Italian Day 2011 – Andrea Grandi

• 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/

Page 39: Meego Italian Day 2011 – Andrea Grandi

Mobility 1.0 – use now

Bearer Management APIContactsLocationMessagingMultimediaPublish and SubscribeService FrameworkSensorsSystem InformationVersit

Mobility 1.1 – develop now, deploy to Ovi Store end of Q1 2011

Camera Document GalleryFeedbackLandmarksMaps/NavigationOrganizerService Framework – Out of process

Page 40: Meego Italian Day 2011 – Andrea Grandi
Page 41: Meego Italian Day 2011 – Andrea Grandi

Required Qt versionnot already installed?

Download and install Qt

InstallQt App

(& SI)

http://wiki.forum.nokia.com/index.php/Nokia_Smart_Installer_for_Symbian

Page 42: Meego Italian Day 2011 – Andrea Grandi

1. Determine the required security / privacy related features

– Most common:

2. Define the capabilities in the Qt project file (.pro)

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

(See: wiki.forum.nokia.com/index.php/Capabilities )

symbian:TARGET.CAPABILITY += Location ReadUserData

* Qt apps are native apps; therefore, the security model of the target operating system applies.

Page 44: Meego Italian Day 2011 – Andrea Grandi

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

Page 45: Meego Italian Day 2011 – Andrea Grandi

WindowsMac OSLinux

N900

Symbian MeeGo

Tech Preview: out now

* Remember: Qt 4.6 apps (= w/o Qt Quick) supported on the Ovi Store for Symbian since summer 2010!

Page 46: Meego Italian Day 2011 – Andrea Grandi

S60 3.1

Symbian^3

Symbian^1S60 5.0S60 3.2

Page 47: Meego Italian Day 2011 – Andrea Grandi
Page 48: Meego Italian Day 2011 – Andrea Grandi

• Qt SDK

– Help, examples

• Discussion boards, wikis

– Forum Nokia: http://www.forum.nokia.com/

– Qt Developer Network: http://developer.qt.nokia.com/

• e-Learning materials

– http://qt.nokia.com/developer/learning/online/training/

– http://qt.nokia.com/services-partners/qt-in-education/qt-in-education-course-material

• Community

– http://www.qtcentre.org/

Page 49: Meego Italian Day 2011 – Andrea Grandi

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

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

Foundations of Qt DevelopmentJohan Thelin. Apress.More in-depth and technically oriented explanation of Qt – different approach to many other books. Generic Qt, no mobile.Status: 2007

Page 50: Meego Italian Day 2011 – Andrea Grandi

• 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++)

Page 52: Meego Italian Day 2011 – Andrea Grandi

• 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/

Page 53: Meego Italian Day 2011 – Andrea Grandi

• 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!

Page 54: Meego Italian Day 2011 – Andrea Grandi

Want to learn more?www.forum.nokia.com/Qt

Andreas JaklSenior Technical Consultant

Forum Nokia