meego widget development using qt wrt @irajlal

46
using Qt Web Runtime July 08, 2010 – Rajesh Lal MeeGo Team, Mountain View, CA Widget Development

Upload: raj-lal

Post on 19-May-2015

240 views

Category:

Technology


3 download

DESCRIPTION

Meego Widget Development using Qt WRT

TRANSCRIPT

Page 1: Meego Widget Development using Qt WRT @iRajLal

using Qt Web Runtime

July 08, 2010 – Rajesh Lal

MeeGo Team, Mountain View, CA

Widget Development

Page 2: Meego Widget Development using Qt WRT @iRajLal

Plan for next 50 minutes

Widget

Qt Web Runtime

Engine

HTML 5, CSS3, AJAX

TechnologyUI Framework, Nokia SDK, Resources

Tools D

evice AP

I

Contacts, GPS, Camera, Accelerometer

feel free to askin between

Page 3: Meego Widget Development using Qt WRT @iRajLal

Widget

• Widget History

• Widget Era

• Nokia WRT Widget

• W3C

• Demo

Page 4: Meego Widget Development using Qt WRT @iRajLal

Widget: History

Tagline - “Whatever you want it to be“

For MacintoshIt ran files called Widgets

Developers: Arlo Rose, Perry Clarke, and Ed Voas (Windows Version)

Konfabulator Feb 10, 2003

Page 6: Meego Widget Development using Qt WRT @iRajLal

Widget Era

Dashcode Widget Yahoo WidgetWindows Gadget

Opera Widget

“Standard” Web technology: HTML, CSS, XML, and JavaScript using browser based rendering engine

Page 7: Meego Widget Development using Qt WRT @iRajLal

2003

2005

2006

2007

2009

Widget Era Timeline

Page 8: Meego Widget Development using Qt WRT @iRajLal

Web Runtime Widget

Nokia Developed Web Runtime in 2005

- Web Runtime was a Portable application framework

-   Allows the creation of widgets on  S60 Platform (3rd Edition)

- Extension to S60 Webkit based browser

- Allows instances of the browser to be run as applications

Nokia Web Runtime also used “standard” HTML, CSS and JavaScript

Page 9: Meego Widget Development using Qt WRT @iRajLal

W3C* Widget 1.0 Specification

* World Wide Web Consortium: Organization which develop standards for Web

A Widget is an interactive single purpose application for displaying and/or updating local data or data on the Web, packaged in a way to allow a single download and installation on a user's machine or mobile device.

Examples:

Clock, Sticky Notes, Weather, News Reader, photo album

Page 10: Meego Widget Development using Qt WRT @iRajLal
Page 11: Meego Widget Development using Qt WRT @iRajLal

Widget: W3C standardization

• Widget APIs• Packaging• Localization• Window Modes• Manifest Configuration file

Page 12: Meego Widget Development using Qt WRT @iRajLal

Widget: How cWRT widget conforms to W3C

• Widget APIs - ‘widget’ object Interface widget.author

widget.version widget.id widget.name widget.description

• Packaging - All files Zipped (inside root folder) and extension .ZIP changed to .WGT

• Localization Folder structure for HelloWorld.WGT-> locales/en/helloworld/-> locales/en-US/helloworld/-> locales/en-GB/helloworld/

Page 13: Meego Widget Development using Qt WRT @iRajLal

Widget: Hello World Demo

• Manifest file config.xml

• Window Modes

- windowed

- fullscreen

- minimized (312x82)

- floating (No support)

- maximized (No support)

Page 14: Meego Widget Development using Qt WRT @iRajLal

Widget: Demo

Hello World

Page 15: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Web Runtime

Widget

Qt Web Runtime

Engine

HTML 5, CSS3, AJAX

TechnologyUI Framework, Nokia SDK, Resources

ToolsD

evice AP

I

Contacts, GPS, Camera, Accelerometer

Page 16: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Web Runtime

WRT evolved into Common Web Runtime which is renamed as Qt WRT

WRT2005

cWRT2008

Qt WRT2010

Page 17: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Common Web Runtime

cWRTCommon

Web

Runtime

Page 18: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: ‘Common’ in cWRT

• Widget object• menu object• MenuItem object• Device object

Nokia Device APIs

• Calendar• Camera• Contacts• Filesystem• Etc.

Platform Services APIs (CJSE*)

* Common Java Script Extension (CJSE) 

Page 19: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: ‘Web’ in cWRT

HTML5

CSS 3

JavaScript• Device APIs

Ajax/JSON

Flash

Audio / Video

SVG

Webkit Engine

Page 20: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Runtime in cWRT

The Runtime allows the Widget to interface to the device

• Interface to Device APIs• Interface to Device functionality

Widget Runtime Device

Page 21: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Runtime in cWRT

Interface to the Device APIs using Feature tag (W3C standard)

API Widget’s Config.xml entry

Contacts API <feature name="nokia://device/contact" />

File System API <feature name="nokia://device/filesystem" />

Media Mgmt API <feature name="nokia://device/media" />

Geolocation API <feature name="nokia://device/geolocation" />

Calendar API <feature name="nokia://device/calendar" />

Messaging(SMS) API <feature name="nokia://device/message" />

Camera API <feature name="nokia://device/camera" />

System Information API <feature name="nokia://device/devicestatus" />

Page 22: Meego Widget Development using Qt WRT @iRajLal

Widget Engine: Runtime in cWRT

Interface to the Device functionality

Functionality URI scheme

Widget’s Config.xml entry

Browser http: <a href=http://testpage.com>test </a>

Messaging sms: <a href="sms:1-555-555-1234“>SMS </a>

Email mailto: <a href="mailto: [email protected]">Email</a>

Phone tel: <a href="tel:1-555-555-1234">Call</a>

Page 23: Meego Widget Development using Qt WRT @iRajLal

Widget: Demo

Web Runtime

Page 24: Meego Widget Development using Qt WRT @iRajLal

Technology behind WRT

Widget

Qt Web Runtime

Engine

HTML 5, CSS3, AJAX

TechnologyUI Framework, Nokia SDK, Resources

ToolsD

evice AP

I

Contacts, GPS, Camera, Accelerometer

Page 25: Meego Widget Development using Qt WRT @iRajLal

Technology behind WRT

• HTML5 • CSS 3• JavaScript 1.5 (some features of 1.6)• Cross Domain Ajax• Flash 10 (!)

Page 26: Meego Widget Development using Qt WRT @iRajLal

Widget: Demo

HTML5Web Workers(Hyper threading)

Video/AudioCanvas

Local Storage

Geolocation

@font-face

Form controls

Ability to describe content

contenteditable 

Page 27: Meego Widget Development using Qt WRT @iRajLal

Widget: Demo

CSS3Rounded Corners

Borders with images

Box Shadow

Multiple Background ImagesText Shadow

@Font-Face

Gradients

Opacity

RGBA ColorsAnimation

Page 28: Meego Widget Development using Qt WRT @iRajLal

Device APIs

Widget

Qt Web Runtime

Engine

HTML 5, CSS3, AJAX

TechnologyUI Framework, Nokia SDK, Resources

ToolsD

evice AP

I

Contacts, GPS, Camera, Accelerometer

Page 29: Meego Widget Development using Qt WRT @iRajLal

Device APIs

• List of APIs currently supported

• Method, Properties supported by each API

• How to Use these APIs in a Widget

• Demo

Page 30: Meego Widget Development using Qt WRT @iRajLal

Supported Device APIs in MeeGo

1. Data•Calendar•Contacts•Commlog•Filesystem•System Information

2. Media•Audio Player (new in M6)•Media•Video Player (new in M6)

3. Utility•Camera•Landmarks (new in M6)•Location•Messaging•Sensor•Telephony

Page 31: Meego Widget Development using Qt WRT @iRajLal

Data APIs in MeeGo

Data

Page 32: Meego Widget Development using Qt WRT @iRajLal

1. Data APIs in MeeGo

Calendar Y/NgetList (async) YgetList (sync) YaddEntry YupdateEntry YdeleteEntry YstartEditor Ycancel YsubscribeNotification YcancelNotification YMeeting YTodo YAnniversary YReminder YDayEvent Y

Contacts Y/NgetContactsAsync YgetContactIdsAsync YgetContactIds YgetContactInfo YaddContact YupdateContact YdeleteContacts YaddGroup YdeleteGroups YupdateGroup YaddContactsToGroup YremoveContactsFromGroup YgetGroupsAsync YgetGroupIdsAsync YgetGroupIds YgetGroupInfo Ycancel YstartNotification YstopNotification YstartEditor Y

Commlog Y/NgetList (async) YgetList (sync) Ycancel YdeleteEntry YsetNotification YcancelNotification YMatchCriteria:type Yflag YnofLogs YphoneNumber YcontactName YstartTime YendTime YLogData:logId Ytype Ytime Yduration YphoneNumber Yflag YcontactName Ysummary YLogIterator:next() YhasNext() Yclose() Y

methods

Object -properties

Page 33: Meego Widget Development using Qt WRT @iRajLal

1. Data APIs in MeeGo

Filesystem Y/NcreateDir Yremove Yrename YgetDirContents Ycopy Ymove Ysearch YgetMountPoints YgetDefaultPath YnotifyMountEvents YcancelNofity YopenFile Yclose Yread YreadLine YreadBase64 Ywrite YwriteLine YwriteBase64 Yflush Yseek Ycancel YgetElementInfo YsearchMatchObject Y

System Information Y/NgetChannelList YgetChannel YstartChannel YstopChannel YsetChannel Ycancel YCharging YBatteryLevel YNetwork YSignal NSignalStrength YPhoneLanguage YBluetoothOn YProductType YFirnwareVersion YHomeNetwork YIMEI YDisplayOrientation YCellularNetworkStatus YDeviceInputMethod YCountryName YIMSI YIMEI Y

System Information Y/NSupportedVideoDecoders YWirelessConnSupport YActiveDataConnections NVibrate YDisplayWallpaper YFlipOpen YListDriveInfo YCriticalMemory NClipBoard YPhoneManufacturer YPhoneModel YPlatformName YPhoneColorDepth YDisplayResolution YBacklightState YKeypadLightState NActiveProfile YPublicId YProcessorUtilication YWebRunTimeInfo Y

Page 34: Meego Widget Development using Qt WRT @iRajLal

3. Use Device APIs in Web Widget

filesystemObject = nokia.device.load("filesystem", null); var dataArray = filesystemObject .getDirContents("file://" + prefix + uri, "*");

for (index in dataArray) { if (dataArray[index].type == 0) { filetype = "[File]"; } else if (dataArray[index].type == 1) { filetype = "[Directory]"; } else { filetype = "[Link]"; }

listing.innerHTML+="<b>" + filetype + " : </b>" + dataArray[index].uri;

File System API

Page 35: Meego Widget Development using Qt WRT @iRajLal

Use Data APIs in Web Widget

sysobject = nokia.device.load("sysinfo", null);

Battery Level API

btr = sysobject.getChannel("BatteryLevel");chr = sysobject.getChannel("Charging");

lastLevel = btr.batteryLevel;

temp = sysobject.getChannel("Network");

element ="<tr><td>"+"Network"+"</td><td>"+"("+"networkName:"+ temp.networkName+")"+"("+"networkStatus:"+ temp.networkStatus+")"+"("+"networkMode:"+ temp.networkMode+")"+"("+"mobileCountryCode:"+ temp.mobileCountryCode+")"+"("+"locationStatus:"+ temp.locationStatus+")"+"("+"areaCode:"+ temp.areaCode+")"+"("+"cellID:"+ temp.cellID+")"+ "</td></tr>";

element = sync_table.innerHTML + element;

System Information

Page 36: Meego Widget Development using Qt WRT @iRajLal

Media APIs in MeeGo

Media

Page 37: Meego Widget Development using Qt WRT @iRajLal

2. Media APIs in MeeGo Media Y/NgetList YaddStreamUri YgetThumbnail YdeleteStreamUri YrefreshMediaDb Ycancel YaddMusicToCollection Yresizeimage Ysize Ydate Ytype Yuri Ytitle Ygenre Ytrack Ycomposer Yalbum Yartist Ysummary Ycopyright Ycomment Yrelease date Ywidth Yheight Ymake N

Media Y/Nmodel YISO speed Yfocal number Yfocal length Yorientation Yx pixel dimention Yy pixel dimention Ybits per pixel Yframe count Ymetering mode Ycolor depth Yoriginal date Ydigitized date Ywhite balance Yflash Yexposure time Yhorizontal resolution Yvertical resolution Yaltitude Ylongitude Ylatitude YCell Id NLocation are code NMobile network code Nheading Ytilt angle Yduration Y

AudioPlayer Y/Nopen Yplay Ypause Yresume Ystop Ygetvolume Ysetvolume Y

Video Player Y/Nopen Yplay Ypause Yresume Ystop Ygetvolume Ysetvolume Y

methods

Object -properties

Page 38: Meego Widget Development using Qt WRT @iRajLal

Use Media APIs in Web Widget

so = nokia.device.load("audioplayer");

so.open(successCBopen, url, errorCB);so.play(successCB, 0, errorCB);so.stop();so.pause();so.resume();so.setVolume(so.getVolume()+10);

Audio Player API

Page 39: Meego Widget Development using Qt WRT @iRajLal

Utility APIs in MeeGo

Utility

Page 40: Meego Widget Development using Qt WRT @iRajLal

3. Utility APIs in MeeGo

Camera Y/NstartCamera YsupportedSizes Y

Landmarks Y/NaddCategory YupdateCategory YdeleteCategory YgetCategories YaddLandmark YupdateLandmark YdeleteLandmark YgetLandmarks YorganizeLandmarks YimportLandmarks YexportLandmarks Ycancel YstartEditor N

Sensor Y/NgetChannels YgetChannelEvent YstartChannel YstopChannel YsetDesiredUpdateFrequency YgetScaleFactor YAccelerometerAxis YOrientation YRotation YAccelerometerDoubleTapping YProximity YIllumination YMagnetometer YMagneticNorth Y

Telephony Y/NinitiateVoiceCall Y

methods

Object -properties

Location Y/NgetCurrentPosition YwatchPosition YclearWatch YgetLocationUsingMethodName Y

positionOptions:enableHighAccuracy Ytimeout YmaximumAge Y

Page 41: Meego Widget Development using Qt WRT @iRajLal

3. Utility APIs in MeeGo Messaging Y/NstartEditor YgetList Ysend YsetNotifier YcancelNotifier YdeleteMessage YgetEmailAccounts Y

getCurrentEmailAccount Y

setCurrentEmailAccount Ycancel YgetMessage YsetStatus Y

Match Pattern datatype Ysenders Ysubject Ystart time Yend time Yfolder Yid Y

Messaging Y/Nto Ycc Ybody Yunread Ypriority Yvalidity Nattachments Ysortkey Ysort order Y

MessageData:type Yto Ybody Ysubject Ycc Yattachments Ypriority Yvalidity Nbcc YdeliveryReport Y

Messaging Y/NMessageInfo:message Ysender Ytime Yunread Yid Yfolder YcontactID Y

Attachment data:uri YmimeType Ysize Y

Account data:accountId Yaccount Name Y

deleteMessage data:id Ytype Yfolder Y

Iterator:next() YhasNext() Yclose() Yreset() Y

Page 42: Meego Widget Development using Qt WRT @iRajLal

3. Use Utlity APIs in Web Widget

this.so = nokia.device.load("geolocation", null);

Location GPS

this.so.getCurrentPosition( function(position) { this.lat = position.coords.latitude; this.lon = position.coords.longitude; } )

Page 43: Meego Widget Development using Qt WRT @iRajLal

Widget: Demo

Device APIs Demo

Page 44: Meego Widget Development using Qt WRT @iRajLal

Tools, UI Frameworks and Resources

Widget

Qt Web Runtime

Engine

HTML 5, CSS3, AJAX

TechnologyUI Framework, Nokia SDK, Resources

ToolsD

evice AP

I

Contacts, GPS, Camera, Accelerometer

Page 45: Meego Widget Development using Qt WRT @iRajLal

Tools, UI Frameworks and Resources

• Nokia WRT wiki http://wikis.in.nokia.com/CommonWebRuntime/CWRTForFremantleDeveloperGuidelines http://wikis.in.nokia.com/CommonWebRuntime/MaemoProducts

• Nokia SDK - http://wikis.in.nokia.com/WRTToolsWiki/WebHome• Web SDK• Web SDK Simulator• Extensions for Dream Weaver / Visual Studio

• W3C Widget http://www.w3.org/TR/widgets-reqs/

• UI Framework - OVI.JS http://wikis.in.nokia.com/OEF/OviAppUi

• Design Guidelines• Device APIs https://cwiki.nokia.com/OSRuntimesTeamWiki/WRTDAWProject

• HTML5 https://cwiki.nokia.com/OSRuntimesTeamWiki/Html5CanvasAndOfflineStudy

Page 46: Meego Widget Development using Qt WRT @iRajLal

Thank You

May the Force be With You !

Questions/ CommentsEmail [email protected]