140 likes | 350 Vues
Developing Widgets for Windows Mobile 6.5. What's different in WM 6.5?. Windows Mobile 6.5 on the emulator. Widgets. Conform to proposed W3C widget standard Based on HTML, JavaScript, CSS Can use XMLHttpRequest or XMLDOM Packaged in .zip format (with . wgt extension)
E N D
Widgets • Conform to proposed W3C widget standard • Based on HTML, JavaScript, CSS • Can use XMLHttpRequest or XMLDOM • Packaged in .zip format (with .wgt extension) • To develop you’ll need the Windows Mobile 6.5 Developer Toolkit (has emulator images)
Manifest (config.xml) Mandatory file • <widget> - Root element • <access> - Network requirements • <content> - required - src attribute links to start file • <description> - um…. • <icon> - A .PNG for touch screen devices
widget manifest (continued) Example: • <?xml version="1.0" encoding="utf-8" ?> • <widget version="1.0.0.0" xmlns="http://www.w3.org/ns/widgets"> • <name>GeekzoneFriends</name> • <content src="startup.htm" type="text/html" /> • <access network="true" /> • <icon src="gzf90.png"/> • <icon src="gzf.ico"/> • <author email="kevindaly@xtra.co.nz" /> • <description>Geekzone status updates</description> • </widget>
JavaScript objects: widget Exposes useful properties and methods e.g. • widget.authorEmail • widget.authorName • widget.menu – the widget’s menu • Also authorURL, currentIcon, description, height, identifier, locale, name, version, width
widget object (continued) • Also exposes persistence methods: • widget.preferenceForKey(key) • widget.setPreferenceForKey(<value>, key);
SystemState object • CradlePresent • DisplayRotation • PhoneHomeService • PhoneOperatorName • PhoneRoaming • PhoneSignalStrength • PowerBatteryState • PowerBatteryStrength
SystemState (continued) Example (from MSDN): varcradledState = systemState.CradlePresent; cradledState.addEventHandler("changed", cradled);
Useful links • http://msdn.microsoft.com/en-us/library/dd721906.aspx - MSDN docs (same title as this presentation) • http://blogs.msdn.com/windowsmobile/archive/2009/06/04/getting-started-with-widgets-on-windows-mobile-6-5.aspx - Introductory post by Jorge Peraza • http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=20686a1d-97a8-4f80-bc6a-ae010e085a6e – Windows Mobile 6.5 Developer Toolkit (includes emulator images) • http://windowsteamblog.com/blogs/windowsphone/archive/2009/08/12/widget-anatomy-the-manifest.aspx - Widget Anatomy - The Manifest
Me again: Kevin Daly (kevindaly@xtra.co.nz) Blog: kevindaly.spaces.live.com (will move to www.kjdaly.com within the next couple of weeks)