+ All Categories
Home > Documents > Qt for s60 Mobile Extensions

Qt for s60 Mobile Extensions

Date post: 08-Apr-2015
Category:
Upload: rahul-chaudhary
View: 277 times
Download: 7 times
Share this document with a friend
94
© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials Company Confidential 1 Qt for S60 Mobile Extensions Pekka Kosonen Head of Technology Development / Forum Nokia
Transcript
Page 1: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials

Company Confidential

1

Qt for S60 Mobile Extensions

Pekka Kosonen

Head of Technology Development /

Forum Nokia

Page 2: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials2

Company Confidential

Pekka Kosonen

• Working in Nokia as Head of Technology Development• Previously as Manager, Professional Support and Senior Technology Expert, area of expertise S60

(Symbian)

• Previous employers: • 2005 – 2006 Digia (previously SysopenDigia & Yomi),

• Teaching history• bread-and-butter during 2000-2005 from JAMK (University of applied science , Jyväskylä)

• 2006 SAMK + Tampere university of technology : mobile programming

• 2007-2008 Tampere university of technology : C, C++, mobile programming

• 2009 TAMK, Qt

• Master of Science, Co writer in “Java 2” book (Docendo, 2005)

• Been working with C, C++, Java, Delphi, numerous Web techniques, XML, Web Services, databases, Symbian S60, Series 40, maemo, Qt.

[email protected]

Page 3: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials3

Company Confidential

Contents

1. Introduction

2. Demos

3. Developing with the extensions

4. Mobile Extensions deep dive

5. Getting our hands dirty

Page 4: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials4

Company Confidential

Qt background

• Trolltech was founded in 1994 and first Qt release went live 1995

• In June 2008 Nokia acquired Trolltech ASA to enable the acceleration of their cross-platform software strategy for mobile devices and desktop applications, and to develop its Internet services business.

• On September 27, 2008 Nokia fully integrated Trolltech and named the new Nokia entity Qt Software.

• Nokia will keep the Qt cross platform focus.

• Trolltech integration changed the way Nokia is thinking

www.qtsoftware.com

Page 5: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials5

Company Confidential

Motivation for Mobile Extensions

1. Qt is easy to learn

2. But Qt doesn’t contain mobile features. Qt itself can be estimated to cover65% of typical use cases for mobile applications.

3. Utilizing Symbian APIs for accessing mobile features is not a great option for a developer who isn’t familiar with Symbian already – learning curve is toolong

4. Qt for S60 mobile extensions offer an easier way to utilize mobile featuresthan using the equivalent Symbian APIs

5. Mobile Extensions are are S60 specific, still evolving and currently no compatibility promise given

• We want early involvement and feedback from you to ensure that the futuresolutions provide what you need!

6. There will be cross platform solutions coming in the future

Page 6: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials6

Company Confidential

Qt for S60 mobile extensions

• Technology Preview available in http://wiki.forum.nokia.com/index.php/Mobile_Extensions

• Extensions are currently delivered as source code and should be added as a part of your Qt for S60 project. The advantage of delivering the Mobile Extensions as source code is that even if the APIs change in the future the change will not cause a break in your application.

• Package contains:

• Seventeen APIs and examples illustrating their use.

• Five demonstration applications. The demonstration applications are available by installing the launcher application included in the delivery package. The demonstrations and examples are build against the Qt for S60 Garden release.

• API documentation

• Carbide class templates to ease taking the extensions to use

Page 7: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials7

Company Confidential

Qt for S60 Mobile Extensions

Make a circuit switched call and getting call status notifications

15. Telephony List available landmarks and add new landmarks 6.Landmarks

Accessing Symbian resource files. 11.Resource Access Providing Audio recording functionality2.Audio API

Accessing central repository and Publish & Subscribe.

13. Settings Manager API You can access contacts database with this. 4.Contacts

*Calendar API coming

17. Vibra

16. Utils

14. System Information

12.Sensors

10.Profile

Mobile Extension

Work ongoing in R&D basement ;)Sending and receiving SMS and MMS messages. 9.Messaging

Using device's vibraRetrieving lists of music, image, video and sound files

located in the gallery 8.Media

Platform specific utils. Accessing device location information. 7.Location

Accessing system information (language, battery, nw, ...) with this.

Silent install functionality5.Installer API

Acceleration and orientation sensor data access

Using device's onboard camera with viewfinder, focus and capturing images.

3.Camera

Reading profile information and setting active profile.

Listing available IAPs (Internet Access Points), setting the IAP to be used, scanning available WLANs etc.

1.Access Point Manager

Purpose Purpose Mobile Extension

Page 8: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials8

Company Confidential

Discussion and feedback

•Which of the APIs (and use cases) do you see most important?

• Do you see any gaps, request for new APIs?

• While going through the APIs feel free to interrupt me with anyquestions or wishes that you have!

Page 9: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials9

Company Confidential

Contents

1. Introduction

2. Demos

3. Developing with the extensions

4. Mobile Extensions deep dive

5. Getting our hands dirty

www.qtsoftware.com

Page 10: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials10

Company Confidential

Demos

• Let’s have a quick look into the Mobile Extension demo applications

• Flickr demonstration: The demonstration uses your location to fetch pictures taken near you.

• Camera & MMS demonstration: The demonstration captures an image using the onboard camera. The picture is sent to a selected contact (as a multimedia messaging service, MMS) and added as your image, which is shown once you call the contact (in vcard terminology called the 'logo', so the demonstration could be called the 'remote logo setter').

• Contact Photo demonstration: The demonstration adds an image to a contact that is shown once the contact calls you (in vcard terminology called the 'logo').

• Bricks demonstration: A game that demonstrates how sensors can be used as input controls.

• Landmarks demonstration: Lists landmarks around the current position (10 km radius). Landmarks are also added to the database of the mobile device. Demonstration also offers a chance to make phone call if a number can be parsed from the name of the landmark.

Page 11: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials11

Company Confidential

Contents

1. Introduction

2. Demos

3. Developing with the extensions

4. Mobile Extensions deep dive

5. Getting our hands dirty

www.qtsoftware.com

Page 12: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials12

Company Confidential

Get the package

• Download the extensions fromhttp://wiki.forum.nokia.com/index.php/Mobile_Extensions and unzip the package

• Free or charge ;)

Page 13: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials13

Company Confidential

The delivery package

• \demos: • Source code for the demonstration applications.

• \doc:• Documentation in HTML format (unzip the zip file to view it). The API

documentation is available also as an Eclipse plugin in http://www.forum.nokia.com/piazza/wiki/images/f/fc/Qt_S60_Mobile_Extensions_eclipse_plugin.zip

• \extensions: • Source codes of the APIs and examples. Also Carbide class templates are

provided in the com.forum.nokia.templates_extensions.jar file.

• \install_to_device: • Required installer packages that can be installed to a target device,

excluding Qt for S60 Garden binaries!

• \install_to_SDK: • Additions to S60 SDKs that are required to develop with the extensions.

• \license.txt: Contains the license agreement.

• \readme.txt : readme file.

Page 14: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials14

Company Confidential

SDK setup and development

• Prerequisites: First install an S60 SDK and then Qt for S60

• Qt for S60 supports S60 3rd Ed FP1 and newer S60 SDKs

• For 3rd ed FP1 Open C is needed

• Some of the Mobile Extensions depend on extra features that are not availablewith the S60 SDK but are available as plugins to the SDKs

• Sensors

• Access Point Manager API

• Installer API

• After your SDK is fine tuned with the plugins you can start developing your Qtapplications using the extensions. The extensions can be added as part of yourapplication

• Either by using the carbide templates

• Or adding the source codes directly to your project (by modifying the .pro file)

• Development can be done using Carbide.c++2.0

Page 15: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials15

Company Confidential

SDK plugins needed

• SDK Plugins

• SDK API pluginhttp://www.forum.nokia.com/info/sw.nokia.com/id/48a93bd5-028a-4b3e-a0b1-148ff203b2b3/Extensions_plugin_S60_3rd_ed.html (now for 5th edition also)

• Sensor plugins

• The sensor API is in S60 5th Edition SDK but for building against older SDKS you'll need the sensor plugins

• Sensor framework API for 3rd edition FP2: http://www.forum.nokia.com/info/sw.nokia.com/id/8059e8ae-8c22-4684-be6b-d40d443d7efc/Sensor_API_Plug_in_S60_3rd_FP2.html

• Sensor plugin : http://www.forum.nokia.com/info/sw.nokia.com/id/4284ae69-d37a-4319-bdf0-d4acdab39700/Sensor_plugin_S60_3rd_ed.html

• See http://wiki.forum.nokia.com/index.php/Category:Sensor for more information

Page 16: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials16

Company Confidential

Setting up the devices

• Install Qt http://www.qtsoftware.com/developer/technical-preview-qt-for-s60

• S60 3rd Edition FP1

• Qt for S60 Garden S60 3rd ed binaries(http://pepper.troll.no/s60prereleases/demos/qt_libs_armv5_udeb_3x.sisx)

• Open C (Qt for S60 ported using Open C)

• Camera wrapper component (if you’re using the camera API) - in the mobile extensions delivery package

• S60 3rd Edition FP2

• Qt for S60 Garden S60 3rd ed binaries

• Camera wrapper component

• S60 5th Edition

• Qt for S60 Garden S60 5th ed binaries(http://pepper.troll.no/s60prereleases/demos/qt_libs_armv5_udeb_50.sisx )

• Camera wrapper component

Page 17: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials17

Company Confidential

Development tools

• In order to develop with the mobile extensions S60 Symbian C++ SDK (3rd ed FP1 or newer) is needed

• With the needed additional SDK plugins

• Carbide.C++ - all versions now free of charge

• All the features that you’ve used with Symbian C++ applications are availablefor Qt applications as well (on device debugging etc.)

• Carbide.C++ includes Qt designer UI editor functionality

Page 18: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials18

Company Confidential

Qt Support in Carbide.c++ 2.0

• Support for Qt development

• Carbide works with Qt projects

• .PRO editor for easy project

configuration

• Package /deploy projects to phone

• Qt plug-ins are included in Carbide

• Qt project Wizard

• Support for Qt UI design tool

• Oh yeah, since Qt for S60 is a

Symbian application, you can use

same tools for debugging, profiling

etc.

Page 19: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials19

Company Confidential

Additional Qt support in Carbide

Qt Template Wizard .PRO Project Editor

Page 20: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials20

Company Confidential

Platform Security

• All platform security rules also apply for Qt applications and Qt applications using Mobile Extensions in the S60 environment. Platform security requires that needed capabilities be defined in the project file. The Qt application may require, for example, the following capabilities:

• AllFiles, when using file operations and accessing protected folders

• NetworkServices should be enough in most cases when using the QtNetwork module,but there might be certain API calls that also require NetworkControl.

• When using Symbian APIs the capabilities needed are, of course, the ones that the APIs define.

• In Qt for S60 applications the capabilities are defined in the .pro file usingTARGET.CAPABILITY keyword, f.ex

TARGET.CAPABILITY = MultimediaDD \

UserEnvironment

Page 21: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials21

Company Confidential

Symbian Signing - recap

• Starting with S60 3rd Edition Platform Security applies all C/C++ applications on S60 devices.

• The same capability and certification rules apply to Qt applicationsas for Symbian C++ applications. Some of the extensions require either a developer certificate or the use of Symbian online signing. For more information about platform security, see http://www.forum.nokia.com/Resources_and_Information/Explore/Development_Process_and_User_Experience/Testing/ and http://developer.symbian.com/wiki/display/pub/Symbian+Signed+FAQ.

• User-grantable capabilities are LocalServices, ReadUserData, WriteUserData, NetworkServices, and UserEnvironment (and Location beginning with S60 3rd Edition, Feature Pack 2).

• If your application uses only these capabilities, the application can be self signed and installed to a "Qt-enabled" S60 mobile device.

Page 22: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials22

Company Confidential

Access point manager

Audio

Camera

Contacts

Landmarks

Media

Messaging

Resource Access

System information

Telephony

Utils

Vibra

Installer

Location

(Profile)

Sensors

(Settings Manager)

Page 23: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials23

Company Confidential

Mobile Extensions and Symbian signed

• From the mobile extensions the following APIs require Symbian signing:

• Installer – trusted UI capability

• Location – location in S60 3.1 is not user grantable

• Sensors – sensor framework requires readDeviceData

• (Settings Manager) – may require capabilities, depends on accessed keys

• (Profile) – doing changes to profile requires writeDeviceData

Page 24: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials24

Company Confidential

Taking the APIs into use

• Developing with the APIs consists of two steps

1. Adding the needed source and headers files as part of your project

2. Adding needed configurations to .pro file

• There are two ways to do this

1. By using Carbide class templates the needed source and hearer files will be addedas part of your project. In addition you’ll need to add the libraries and capabilititiesto the .pro file. An example from the camera API

symbian:LIBS += -lmediaclientaudio \

-lmediaclientaudioinputstream

symbian:TARGET.CAPABILITY += UserEnvironment

2. Another option is not to use the Carbide class templates but to copy the API implementation (sources and headers) to your project folder and add the headersand sources to .pro file. Also the needed libraries and capabilities need to be defined(same as with the Carbide class templates).

• In the API documentation refer to the implementation notes that shows the needed additions to the .pro file for each of the APIs!

• In the hands-on exercise instruction both of these options are shown in a step-by-step tutorial

Page 25: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials25

Company Confidential

Contents

1. Introduction

2. Demos

3. Developing with the extensions

4. Mobile Extensions deep dive

5. Getting our hands dirty

Page 26: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials26

Company Confidential

1. Access PointManager API

•Why is this API needed?

• Qt doesn’t offer any way to control network access

• Notes : Qt for S60 networking build on top of Open C sockets (not usingRConnection)

• Controlling the access points to be used for connections available withdependency on Open C 1.5 (beta) setdefaultIf function

• Depends on SDK API plugin(http://wiki.forum.nokia.com/index.php/SDK_API_Plugin)

• Applications utilizing this API can be self signed

Page 27: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials27

Company Confidential

1. Access PointManager API cnt’d

• Use cases

• Showing native system internet access point dialog (see systemAccessPoint() )

• Getting lists of defined access points (accessPoints() )

• Scanning for available WLANs (availableWLANs () )

• Setting the internet access point to be used for following connections ((see setDefaultAccessPoint(const XQAccessPoint &iap))

• Listing active internet access points (see activeAccessPoints() )

• Convinience function for finding a preferred access point (preferredAccessPoint());

• ALR not included in this API (yet)

• Main class XQAccessPointManager

• Internet access point (IAP) represented as XQAccessPoint

Page 28: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials28

Company Confidential

1. Access Pointmanager – add to .pro file

HEADERS += xqaccesspointmanager.h

SOURCES += xqaccesspointmanager.cpp

symbian: {

HEADERS += xqaccesspointmanager_s60_p.h

SOURCES += xqaccesspointmanager_s60_p.cpp

}

symbian:LIBS += -lcommdb \

-lapengine \

-lapsettingshandlerui \

-lconnmon \

-lcentralrepository \

-lesock \

-lecom \

-lefsrv

symbian:TARGET.CAPABILITY = ReadUserData

Page 29: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials29

Company Confidential

1. Access Pointmanager – code snippet

• An example of querying available access points (that can be connectedto, wlan IAPs that are out of reach are filtered out)

apManager = new XQAccessPointManager(this);

QList<XQAccessPoint> accessPoints =

apManager->availableAccessPoints();

XQAccessPoint ap = accessPoints.at(0);

if (!ap.isNull()) {

apManager->setDefaultAccessPoint(ap));

}

Page 30: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials30

Company Confidential

2. Audio API

• The Audio API complements Phonon that offers audio playback functionality

• Use cases

• Non-streaming audio recording

• Streaming audio recording

• Can be used to record telephony calls as well

• In Symbian no way to record from downlink only though, the whole

conversation is always recorderd

Page 31: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials31

Company Confidential

2. Audio API – add to .pro file

HEADERS += xqaudio.h \

xqaudio_p.h

SOURCES += xqaudio.cpp \

xqaudio_p.cpp

symbian:LIBS += -lmediaclientaudio \

-lmediaclientaudioinputstream

symbian:TARGET.CAPABILITY += UserEnvironment

Page 32: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials32

Company Confidential

2. Audio API - code snippet

XQAudioRecord audio = new XQAudioRecord(this);

// You can start recording with this

audio->start();

// You can get recorded file's name with fileName() function

QString fileName = audio->fileName();

// Or this for recording to specified

audio->start("C:\\data\\file.wav");

// NOTE: Remember stop recording

audio->stop();

Page 33: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials33

Company Confidential

3. Camera API

• Many mobile devices come with a camera built in. The Camera API allows you to access the camera functionality on your device so that you can first see a preview of the image you might take, then focus the camera, and then actually take the photo.

• In addition provides a convinient viewfinder widget for showing the camera view inside your applicaiton

Page 34: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials34

Company Confidential

3. Camera API

• Enables Qt applications to access the device camera

• Viewfinding (preview before image capture)

• Controlling focus on autofocus-enabled devices

• Capturing images directly in JPEG/EXIF format

• Main classes

• XQCamera

• XQViewFinderWidget

• Automatically displays and updates the camera viewfinder area

�Camera API depends on the CameraWrapper library, delivered as part of Mobile Extensions. CameraWrapper.sisx file must be installed on the device.

• Note; currently emulator binaries not included so can’t build for emulator

• Applications utilizing this API can be self signed.

Page 35: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials35

Company Confidential

Camera API / Usage

• Camera initializationcamera = new XQCamera( this );

camera->setCaptureSize(QSize(1280, 960));

camera->open( 0 );

• Parameter passed to open() defines which camera to use

• 0: Rear (main) camera

• 1: Front camera

• Use XQCamera::camerasAvailable() to check number of available

cameras

• Viewfinder initialization

viewFinder = new XQViewFinderWidget( this );

viewFinder->setCamera( *camera );

viewFinder->setViewfinderSize( QSize( 128, 96 ) );

Page 36: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials36

Company Confidential

• XQCamera

• cameraReady() signal is emitted in response to XQCamera::open()

• focused() signal is emitted in response to focus()

• captureCompleted() signal returns a byte array with captured JPEG

• error() signal is emitted when an asyncronous operation fails

• close()will release the camera

Camera API / Signals and Slots (1/2)

Signals

cameraReady()

focused()

captureCompleted(QByteArrayimageData)

error(XQCamera::Error error)

Slots

bool capture()

void close()

bool focus()

void cancelFocus()

Page 37: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials37

Company Confidential

• XQViewFinderWidget

• start() starts updating the viewfinder, returns true if successful

• Remember to call SetCamera() prior to calling start()

• stop() pauses the viewfinder (last viewfinder frame stays on screen)

• XQViewFinderWidget::Error error() returns the last occurrederror.

Camera API / Signals and Slots (2/2)

Slots

bool start()

void stop()

Page 38: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials38

Company Confidential

3. Camera API – add to .pro file

HEADERS += xqcamera.h \

xqcamera_p.h \

xqviewfinderwidget.h \

xqviewfinderwidget_p.h

SOURCES += xqviewfinderwidget.cpp \

xqviewfinderwidget_p.cpp \

xqcamera.cpp \

xqcamera_p.cpp

symbian:LIBS += -lcamerawrapper \

-lfbscli

symbian:TARGET.CAPABILITY = UserEnvironment

Page 39: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials39

Company Confidential

• Connecting the signals and slots// Start viewfinder immediately after camera is ready

connect( camera, SIGNAL( cameraReady() ), viewFinder, SLOT( start() ) );

// Pass each captured image to function that saves the image to a file

connect( camera, SIGNAL( captureCompleted( QByteArray ) ),

this, SLOT( saveCapturedImage( QByteArray ) ) );

// Devices WITH AutoFocus support: Focus and capture automatically once focused

connect( captureButton, SIGNAL( clicked() ), camera, SLOT( focus() ) );

connect( camera, SIGNAL( focused() ), camera, SLOT( capture() ) );

// OR:

// Devices WITHOUT AutoFocus support: Capture directly

connect( captureButton, SIGNAL( clicked() ), camera, SLOT( capture() ) );

3. Camera API / Example use

Page 40: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials40

Company Confidential

3. Camera API – code snippets

XQCamera *camera = new XQCamera(this);

XQViewFinder *viewFinder = new XQViewFinderWidget(this);

viewFinder->setCamera(*camera);

viewFinder->setViewfinderSize(QSize(128, 96));

connect(captureButton,SIGNAL(clicked()),camera,SLOT(capture()));

connect(camera,SIGNAL(captureCompleted(QByteArray)),this,SLOT(imageCaptured(QByteArray)));

connect(camera,SIGNAL(cameraReady()),viewFinder,SLOT(start()));

void CameraExample::imageCaptured(QByteArray imageData)

{

QImage capturedImage = QImage::fromData(imageData);

//you could save the file with: capturedImage.save(filepath);

viewFinder->stop();

viewFinder->setImage(captureImage);

QTimer::singleShot(5000,viewFinder,SLOT(start()));

}

Page 41: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials41

Company Confidential

Camera API hands-on demo

• Let’s take the camera API into use, also using the messaging extension

Page 42: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials42

Company Confidential

4. Contacts API

• The Contacts API gives you access to the contacts database on the device.

• S60 devices have a contact database where you can store phone numbers and other information about people you know. The Contacts API allows you to access the data in the database and update it.

• Main use cases

• Accessing contacts

• Finding a contact

• Creating a new contact

• Removing a contact

• Applications utilizing this API can be self signed.

Page 43: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials43

Company Confidential

4. Contacts API – add to .pro file

HEADERS += xqcontacts.h \

xqcontact.h \

xqcontact_p.h

SOURCES += xqcontacts.cpp \

xqcontact.cpp \

symbian: {

HEADERS += xqcontacts_s60_p.h

SOURCES += xqcontacts_s60_p.cpp

}

symbian:LIBS += -lcntmodel \

-lbafl \

-lefsrv \

-lestor \

-lexiflib.dll

symbian:TARGET.CAPABILITY = ReadUSerData \

WriteUserData

Page 44: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials44

Company Confidential

4. Contacts API – code snippet

contacts = new XQContacts(this);

QList<XQContact> contactList =

contacts->findContacts("+358501234567",

XQContactField::ContactFieldTypePhoneNumber);

Page 45: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials45

Company Confidential

Contacts API hands-on demo

• Let’s take the contacts API into use

Page 46: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials46

Company Confidential

5. Installer API

• The Installer API provides methods to install and uninstall applications without informing the user though the standard installation dialogs. This means you can create your own installation user interface.

• You can also use the Installer API to get a list of all the applications that are installed on the device.

• Depends on SDK API plugin(http://wiki.forum.nokia.com/index.php/SDK_API_Plugin)

• Requires TrustedUI capability so Symbian signing is needed

Page 47: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials47

Company Confidential

5. Installer API – add to .pro file

HEADERS += xqinstaller_p.h \

xqinstaller.h \

SOURCES += xqinstaller_p.cpp \

xqinstaller.cpp

symbian:LIBS += -lswinstcli \

-lcommdb \

-lapparc \

-lefsrv \

-lapgrfx

symbian:TARGET.CAPABILITY += TrustedUI

Page 48: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials48

Company Confidential

5. Installer API – code snippet

XQInstaller *installer = new XQInstaller(this);

installer->install(

"c:\\Data\\Installs\\examplepackage.sisx");

Page 49: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials49

Company Confidential

6. Landmarks API

• A landmark is essentially a location with a name. It may also contain other data such as description, icon, address details etc.

• Landmarks API provides access to the landmarks stored on the device

• Also possible to add a new landmark

• Applications utilizing this API can be self signed

Page 50: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials50

Company Confidential

6. Landmarks API – add to .pro file

HEADERS += xqlandmarksmanager.h \

xqlandmarksmanager_p.h \

xqlocation.h \

xqlocation_s60_p.h

SOURCES += xqlandmarksmanager.cpp \

xqlandmarksmanager_p.cpp \

xqlocation.cpp \

xqlocation_s60_p.cpp

symbian:LIBS += -llbs -leposlandmarks

symbian:TARGET.CAPABILITY += ReadUserData WriteUserData

Page 51: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials51

Company Confidential

6. Landmarks API – code snippet

XQLandmarkManager* landmarkManager =

new XQLandmarkManager();

QList<int> ids = landmarkManager->landmarkIds();

for (int i=0; i<ids.count(); i++)

{

listWidget->addItem(

landmarkManager->landmark( ids.value(i)).name()

);

}

Page 52: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials52

Company Confidential

7. Location API

• Many mobile devices come with GPS receivers built-in which enables the device to find its location coordinates. The Location API allows your application to access this information so that your application can determine the location of the device.

Requires Location capability that

in S60 3rd Edition and 3rd Edition FP1 is not user grantable -> Symbian signing required

Page 53: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials53

Company Confidential

7. Location API – add to .pro file

HEADERS += xqlocation.h

SOURCES += xqlocation.cpp

symbian: {

HEADERS += xqlocation_s60_p.h

SOURCES += xqlocation_s60_p.cpp

}

else {

HEADERS += xqlocation_stub_p.h

SOURCES += xqlocation_stub_p.cpp

}

symbian:LIBS += -llbs

symbian:TARGET.CAPABILITY = Location

Page 54: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials54

Company Confidential

7. Location API – code snippet

location = new XQLocation(parent);

connect(location, SIGNAL(locationChanged(double, double,

double, float)), this, SLOT(locationChanged(double, double,

double, float)));

location->startUpdates();

Page 55: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials55

Company Confidential

8. Media API

• The Media API is used for retrieving lists of music, image, video and sound files located in the phone.

• A mobile device can be used to store all kinds of media. The Media API gives you easy access to the filenames of these media files.

• Getting a list of all images, videos and sounds on the device gallery

• Getting the thumbnail from image's exif data

• Getting the thumbnail for a video (1st frame)

• Applications utilizing this API can be self signed

Page 56: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials56

Company Confidential

8. Media API – add to .pro file

HEADERS += xqmedia.h \

xqmedia_p.h

SOURCES += xqmedia.cpp \

xqmedia_p.cpp

symbian:LIBS += -lcontentlistingframework \

-lapmime \

-lcommonui \

-lexiflib.dll \

-lefsrv

Page 57: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials57

Company Confidential

8. Media API – code snippet

XQMedia *media = new XQMedia(this);

QListWidget *listWidget = new QListWidget(this);

connect(media,SIGNAL(listAvailable(QStringList)),this,SLOT(listFiles(QStringList)));

// The slot listFiles() implemented as an example below:

void MediaExample::listFiles(QStringList fileList) {

QStringListIterator i(fileList);

while (i.hasNext()) {

// Intrested in only the file name (not full path)

listWidget->addItem(i.next().split("\\").takeLast());

}

}

Page 58: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials58

Company Confidential

9. Messaging API

• The messaging API allows you to send messages with the device and receive notifications of new messages. The currently supported message types are SMS and MMS.

• Main class is XQMessagingwhile messages are represented as XQMessage

• The message type is differentiated depending on attachments. If there is an attachment an MMS is sent.

XQMessage message ( to, body, filepathToAttachment );

messaging->send(message); //sends an MMS

• Applications utilizing this API can be self signed

Page 59: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials59

Company Confidential

9. Messaging API – add to .pro file

HEADERS += xqmessaging.h

SOURCES += xqmessaging.cpp

symbian: {

HEADERS += xqmessaging_s60_p.h

SOURCES += xqmessaging_s60_p.cpp

}

symbian:LIBS += -lsendas2 \

-lmsgs \

-letext \

-lefsrv \

-lcharconv \

-lgsmu

symbian:TARGET.CAPABILITY = NetworkServices \

LocalServices \

ReadUserData \

WriteUserData \

UserEnvironment

Page 60: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials60

Company Confidential

9. Messaging API – code snippet

//sending a message

messaging = new XQMessaging(this);

XQMessage message("+3580501234567","Test SMS");

messaging->send(message);

//receiving incoming messages (only MMS in this case)

connect(messaging, SIGNAL(messageReceived(const XQMessage

&)), this, SLOT(mmsMessageReceived(const XQMessage &)));

messaging->startReceiving(XQMessaging::MsgTypeMMS);

Page 61: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials61

Company Confidential

10. Profile API

• The profile API allows you to choose the profile setting on your device

• A profile determines how a phone behaves when messages or phone calls are received. For example, if the Silent profile is active, the phone will not play any sounds when a message or phone call is received. The profiles API allows you to set the current profile and also find out find out what the current profile setting is.

• For changes to the profile WriteDeviceData is needed and applications

utilizing that functionality need to be Symbian Signed

• Reading profile information doesn’t require Symbian Signing

Page 62: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials62

Company Confidential

10. Profile API – add to .pro file

HEADERS += xqprofile.h \

xqprofile_p.h \

cflightmodechecker.cpp

SOURCES += xqprofile.cpp \

xqprofile_p.cpp \

cflightmodechecker.cpp

symbian:LIBS += -lprofileengine \

-letel3rdparty \

-lfeatdiscovery

symbian:TARGET.CAPABILITY += WriteDeviceData

Page 63: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials63

Company Confidential

10. Profile API – code snippet

//get the active profile

XQProfile *profile = new XQProfile(this);

XQProfile::Profile activeProfile = profile->activeProfile();

//set the profile to silent

XQProfile *profile = new XQProfile(this);

profile->setActiveProfile(XQProfile::ProfileSilentId);

Page 64: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials64

Company Confidential

11. Resource Access API

• This API allows you to load strings from a specific Symbian resource file by using a certain resource id.

• With this API porting from Symbian to Qt can be made in steps by usingexisting Symbian resource files in Qt applications.

• In some cases using existing Symbian resource files on the device may beneeded, f.ex accessing Avkon resource files to acquire certain value

• Applications utilizing this API can be self signed

Page 65: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials65

Company Confidential

11. Resource Access API – add to .pro file

HEADERS += \

xqresourceaccess.h \

xqresourceaccess_p.h

SOURCES += xqresourceaccess.cpp \

xqresourceaccess_p.cpp

symbian:LIBS += -lbafl \

-lefsrv

Page 66: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials66

Company Confidential

11. Resource Access API – code snippet

XQResourceAccess *resourceAccess = new

XQResourceAccess(this);

resourceAccess-

>openResourceFile("Z:\\resource\\avkon.r01");

// Reading resources to QString

QString resource = resourceAccess-

>loadStringFromResourceFile(R_QTN_WEEK_LONG_MONDAY);

Page 67: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials67

Company Confidential

12.Sensors API

• The Sensor APIs give you access to the sensors on the device.

• Mobile devices come with sensors that allow you to detect what is happening to the device. For example, an acceleration sensor can tell you that your device is accelerating in a particular direction. Other sensors detect the environment where the device is situated, e.g. the light level or how close it is to the user.

• Currently accelerometer and orientation data is supported

• Note - depends on Sensor plugins that are needed to install to S60 SDK

• Sensor framework requires ReadDeviceData capability and requireSymbian signing

Page 68: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials68

Company Confidential

12. Sensors API –

add to .pro fileHEADERS += xqaccsensor.h \

xqsensor.h

SOURCES += xqaccsensor.cpp \

xqsensor.cpp

exists($${EPOCROOT}epoc32/include/sensrvchannel.h)

{

message("Building for Sensor Framework")

DEPENDPATH += ..\src\framework

HEADERS += xqsensor_p.h \

xqaccsensor_p.h

SOURCES += xqsensor_p.cpp \

xqaccsensor_p.cpp

symbian:TARGET.CAPABILITY = ReadDeviceData

symbian:LIBS += -lSensrvClient \

-lsensrvutil

}

else {

exists($${EPOCROOT}epoc32/include/rrsensorapi.h) {

message( "Building for Sensor plugin" )

DEPENDPATH += ..\src\plugin

HEADERS += xqsensor_p.h \

xqaccsensor_p.h

SOURCES += xqsensor_p.cpp \

xqaccsensor_p.cpp

symbian:LIBS += -lRRSensorApi

} else {

message("Error: Sensor API not found")

}

}

Page 69: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials69

Company Confidential

12. Sensors API – code snippet

XQDeviceOrientation* orientation = new XQDeviceOrientation(this);

orientation->setResolution(5); //degrees

QObject::connect(

orientation, SIGNAL(rotationChanged(int, int, int)),

this, SLOT(rotationChanged(int, int, int)));

//…

void SensorTest::rotationChanged(int xRotation, int yRotation, int zRotation)

{

m_x = xRotation;

m_y = yRotation;

m_z = zRotation;

update(); //repaint();

}

//xRotation Rotation of x axis in degrees (0-359).

//yRotation Rotation of y axis in degrees (0-359).

//zRotation Rotation of z axis in degrees (0-359).

Page 70: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials70

Company Confidential

Sensors API hands-on demo

• Let’s take the sensors API into use

• Demonstrate showing the sensors data retrieved fromXQDeviceOrientation class

• After the hands-on let’s have a look at *bit* more advanced demo showing a moving picture

Page 71: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials71

Company Confidential

13.Settings manager

• The Symbian Platform has two mechanisms for managing system-wide settings: Publish and Subscribe and Central Repository. The Settings Manager API provides access to these mechanisms

• Setting include bluetooth state, profile information, call status etc.

• Main use cases

• Monitoring changes in one or more items

• Reading item values

• Setting item values

• Creating new items

• Deleting items

• Applications utilizing this API can be self signed (unless accessing keys that areprotected with capability requirements)

Page 72: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials72

Company Confidential

13. SettingsManager API – add to .pro file

HEADERS += xqsettingsmanager.h \

xqsettingsmanager_p.h \

subscriber.h \

xqsettingsitem.h \

cenrepnotifier.h

SOURCES += xqsettingsmanager.cpp \

xqsettingsmanager_p.cpp \

subscriber.cpp \

xqsettingsitem.cpp \

cenrepnotifier.cpp

symbian:LIBS += -lcentralrepository \

-lcommonengine

Page 73: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials73

Company Confidential

13. SettingsManager API – code snippet

XQRepositoryItem profileItem (KCRUidProfileEngine.iUid,KProEngActiveProfile);

// Profile central repository key being monitored

settingsManager = new XQSettingsManager(profileItem, this);

connect(settingsManager,SIGNAL(valueChanged(XQSettingsItem)),this,SLOT(handle

Changes(XQSettingsItem)));

XQPropertyItem chargerItem(KPSUidHWRMPowerState.iUid,KHWRMChargingStatus);

settingsManager->startMonitoring(chargerItem);

// Now charger state (P&S property) is also being monitored

Page 74: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials74

Company Confidential

14.System information API

• System information API provides information about the device, networkand some end user setting

• Main use cases

• Getting the IMEI of the device

• Getting notifications of network signal strength changes

• Getting notifications of battery charge level changes

• Getting amount of free RAM memory

• Getting the amount of free disk space Why is this API needed?

• Applications utilizing this API can be self signed

Page 75: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials75

Company Confidential

14. System Information API – add to .pro

file

HEADERS += xqsysinfo.h \

xqsysinfo_p.h \

CDeviceInfo.h \

networksignalmonitor.h \

batterymonitor.h

SOURCES += xqsysinfo.cpp \

xqsysinfo_p.cpp \

CDeviceInfo.cpp \

networksignalmonitor.cpp \

batterymonitor.cpp

symbian:LIBS += -letel3rdparty \

-lsysutil \

-lefsrv \

-lfeatdiscovery

symbian:TARGET.CAPABILITY = ReadDeviceData

Page 76: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials76

Company Confidential

14. System Information API – snippet

XQSysInfo *systemInfo = new XQSysInfo(this);

QString imei = systemInfo->imei();

QString softwareVersion = systemInfo->softwareVersion();

QString currentLanguage = handleLanguage(sysInfo->currentLanguage());

QString imsi = systemInfo->imsi();

QString model = systemInfo->model();

QString manufacturer = systemInfo->manufacturer();

QString signalStrenght = QString::number(systemInfo->signalStrength());

QString batteryLevel = QString::number(systemInfo->batteryLevel());

QString diskSpace = QString::number(systemInfo->diskSpace(XQSysInfo::CDrive));

#include <featureinfo.h>

bool flightModeOn = XQSysInfo::isSupported(KFeatureIdFlightMode);

Page 77: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials77

Company Confidential

15. Telephony API

•With the Telephony API you can make phone calls from your device. You can also use the API to notify you when the phone call status changes, e.g. there is a new incoming phone call or an existing phone call finishes.

• Applications utilizing this API can be self signed

Page 78: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials78

Company Confidential

15. Telephony API – add to .pro file

HEADERS += XQTelephony.h \

XQTelephony_p.h \

ccalldialer.h \

ctelephonymonitor.h

SOURCES += XQTelephony.cpp \

XQTelephony_p.cpp \

ccalldialer.cpp \

ctelephonymonitor.cpp

symbian:LIBS += -letel3rdparty \

-lcntmodel \

-lbafl \

-lefsrv \

-lestor \

-lexiflib.dll

symbian:TARGET.CAPABILITY += NetworkServices \

ReadUserData \

WriteUserData

Page 79: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials79

Company Confidential

15. Telephony API – code snippet

//making a call

XQTelephony *telephony = new XQTelephony(this);

telephony->call("+358401234567");

//receiving notifications of call status changes

XQTelephony *telephony = new XQTelephony(this);

connect(telephony,SIGNAL(lineStatusChanged(XQTelephony::LineStatus,QString)),

this,SLOT(handleStatusChange(XQTelephony::LineStatus,QString)));

// handleStatusChange() slot implementation is presented below

void TelephonyExample::handleStatusChange(XQTelephony::LineStatus status, QStringnumber) {

if (lineStatus == XQTelephony::StatusRinging) {

// Caller's number can be retrieved via number parameter

}

}

Page 80: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials80

Company Confidential

• The current status of the voice call line on the phone is indicated by XQTelephony::LineStatusenumeration. When the status changes, the lineStatusChanged() signal is emitted. The diagram below is a state transition diagram showing how the LineStatus moves between states.

15. Telephony API – line status

Page 81: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials81

Company Confidential

16. Utils API

• Utils API is our ”garbage can” providing different sorts of services

• Main use cases

• Keeping the backlight turned on

• String conversions

• Launching a file in default viewer application (similar to QDesktopServices)

• Applications utilizing this API can be self signed

Page 82: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials82

Company Confidential

16. Utils API – add to .pro file

HEADERS += xqutils.h \

xqutils_p.h

SOURCES += xqutils.cpp \

xqutils_p.cpp

symbian:LIBS += -lapmime \

-lcommonui \

-lplatformenv

Page 83: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials83

Company Confidential

16. Utils API – code snippet

XQUtils *utils = new XQUtils(this);

QTimer *timer = new QTimer(this);

timer->setInterval(10000);

timer->start();

// This connects timer's timeout() SIGNAL to call

XQUtils::resetInactivityTime()

connect(timer, SIGNAL(timeout()), utils,

SLOT(resetInactivityTime()));

Page 84: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials84

Company Confidential

17. Vibra API

• The XQVibra class is used to control the device vibra

• Applications utilizing this API can be self signed

Page 85: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials85

Company Confidential

17. Vibra API – add to .pro file

HEADERS += xqvibra_p.h \

xqvibra.h \

SOURCES += xqvibra_p.cpp \

xqvibra.cpp \

symbian:LIBS += -lhwrmvibraclient

Page 86: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials86

Company Confidential

17. Vibra API – code snippet

XQVibra vibra = new XQVibra(this);

// This starts vibra for 3 seconds

vibra->start(3000);

// This sets vibration intensity. Possible values are

between -100 and 100.

vibra->setIntensity(50);

// This stops vibra

vibra->stop();

Page 87: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials87

Company Confidential

Contents

1. Introduction

2. Demos

3. Developing with the extensions

4. Mobile Extensions deep dive

5. Getting our hands dirty

Page 88: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials88

Company Confidential

Exercises

• Now you’ve seen how it’s done it’s time to do it yourself!

• Three exercises are instructed in the following document

• http://www.forum.nokia.com/piazza/wiki/images/a/a9/Qt_for_s60_hands_on.zip

• Also paper copies available

Page 89: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials89

Company Confidential

Hands-on setups

For the hands-on the setup can be one of the following:

1. S60 5th Edition SDK (v0.9 or 1.0)

2. S60 3rd Edition FP2 SDK• In addition Sensor framework plugin for 3rd edition FP2: http://www.forum.nokia.com/info/sw.nokia.com/id/8059e8ae-8c22-4684-

be6b-d40d443d7efc/Sensor_API_Plug_in_S60_3rd_FP2.html

3. S60 3rd Edition FP1 • In addition Open C http://www.forum.nokia.com/Resources_and_Information/Explore/Runtime_Platforms/Open_C_and_C++/

• And Sensor plugin : http://www.forum.nokia.com/info/sw.nokia.com/id/4284ae69-d37a-4319-bdf0-d4acdab39700/Sensor_plugin_S60_3rd_ed.html

• Install Qt for S60: http://pepper.troll.no/s60prereleases/

• Download the mobile extensions from http://wiki.forum.nokia.com/index.php/Mobile_Extensions

• Have a phone compatible with your SDK, see http://www.forum.nokia.com/devices/

• S60 3.2 and 5.0 SDKs can be downloaded from http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html

• S60 3.1 SDK available in http://www.forum.nokia.com/info/sw.nokia.com/id/4a7149a5-95a5-4726-913a-3c6f21eb65a5/S60-SDK-0616-3.0-mr.html

Page 90: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials90

Company Confidential

Hands-on demos – camera and messaging

• S60 5th ed

• Camera viewfinder, capture, send as mms

• TODO camera vaatii multimediaDD:n (TAI ei sittenkään)

• Ota camera example pohjaksi, jatka tuosta

• void CameraExWindow::captured(QByteArray imageData)

• Lisää MMS:n lähettäminen

• TODO laita valmiiksi toi C:\presentation\Qt_for_universities\hands_on\extensions\extensions\camera\example,

tulosta ja hihglightaa muutokset

• TODO tee pohja valmiiksi eli cameraEx ja poista multimediaDD

• Vaihtoehto 2 – list images from gallery, select first one and send as mms – tää voisi

olla harjoitustehtävänä?

• Sensors for tube

Page 91: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials91

Company Confidential

1. Camera& MMS demo

1. Remove multimediadd capability fromcameraex• jää pelkästään TARGET.CAPABILITY =

UserEnvironment

2. Import to carbide

3. File->new->Symbian OS C++ class1. Select Messaging API extension

4. Add to .pro

symbian:LIBS += -lsendas2 \

-lmsgs \

-letext \

-lefsrv \

-lcharconv \

-lgsmu

symbian:TARGET.CAPABILITY = NetworkServices \

LocalServices \

ReadUserData \

WriteUserData \

UserEnvironment

1. Code• jää pelkästään TARGET.CAPABILITY =

UserEnvironment

2. Add self signed sis (properties->carbide.c++->build configurations)

Page 92: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials92

Company Confidential

Sensors hands-on

• Create new project

• Copy sensor api files (all) to project folder

• Add to .pro

• HEADERS += xqaccsensor.h \

• xqsensor.h

• SOURCES += xqaccsensor.cpp \

• xqsensor.cpp

• exists($${EPOCROOT}epoc32/include/sensrvchannel.h) {

• message("Building for Sensor Framework")

• DEPENDPATH += .\framework

• HEADERS += xqsensor_p.h \

• xqaccsensor_p.h \

• xqdeviceorientation.h \

• xqdeviceorientation_p.h

• SOURCES += xqsensor_p.cpp \

• xqaccsensor_p.cpp \

• xqdeviceorientation.cpp \

• xqdeviceorientation_p.cpp

• symbian:TARGET.CAPABILITY = ReadDeviceData

• symbian:LIBS += -lSensrvClient \

• -lsensrvutil

• } else {

• exists($${EPOCROOT}epoc32/include/rrsensorapi.h) {

• message( "Building for Sensor plugin" )

• DEPENDPATH += .\plugin

• HEADERS += xqsensor_p.h \

• xqaccsensor_p.h

• SOURCES += xqsensor_p.cpp \

• xqaccsensor_p.cpp

Page 93: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials93

Company Confidential

More information

• The best place to get started with Qt development is Qt SW units web page www.qtsoftware.com

• Qt for S60 Mobile Extensions technology preview available in http://wiki.forum.nokia.com/index.php/Mobile_Extensions

• ’Introduction to Qt on mobile platforms’ e-learning

• http://www.forum.nokia.com/info/sw.nokia.com/id/917eef55-499c-413f-9555-ce1bb2878665/Introduction_to_Qt_on_Mobile_Platforms.html

• Qt for S60 Discussion board (monitored by FN experts)

• http://discussion.forum.nokia.com/forum/forumdisplay.php?f=196

• Qt for S60 Wiki

• http://wiki.forum.nokia.com/index.php/Category:Qt_for_S60

• All the FN documents will be linked to from the following page

• http://www.forum.nokia.com/Resources_and_Information/Documentation/Qt_for_S60.xhtml

• Qt for maemo : http://qt4.garage.maemo.org

Page 94: Qt for s60 Mobile Extensions

© 2008 Nokia V1-Filename.ppt / YYYY-MM-DD / Initials

Company Confidential

94

Questions?

[email protected]


Recommended