Knowledge Base


Getting started with widgets on i8910 HD
Views : 6525   l  comments : 0   l  Type : Guides
Jun 30, 2009 17:35 GMT+1
 

The Samsung i8910 HD is the first S60 device from Samsung to support Samsung Mobile Widgets.

Samsung Mobile Widgets are WebKit browser based runtime widgets that install directly to the widget tray in the TouchWiz UI home screen on Samsung phones, and run directly in the home screen when launched.

As we prepare our Getting Started guide, this Simple Widget is a first example to get you started.

NOTE: Updated to v1.1 Wed Jul 01 2009 - Corrected HTML background colour note in example.js



Installing the Simple Widget


Download the SimpleWidget-1-1.wgt package from the link below, Bluetooth or copy to a device, and open. The i8910 HD installer will recognise the widget and install it to the widget tray.

Or, follow the instructions at the resources page and load into a Lab.dev device or the DevPack i8910 HD Emulator.



Running the Simple Widget

To launch - drag the widget icon from the widget tray onto the homescreen. The widget will launch into its idle state.

To activate - touch the widget background to launch the widget into its activated state.

To cycle through the images - touch the foreground image displayed by the activated widget.

To return the widget to idle state - touch the background of the activated widget.

To test the widget network functionality - touch the "testing" button of the idle widget. The widget will request a network connection, and fetch a page from the internet and dump the page source.

To close the widget - drag it back to the widget tray from idle or activated state.



Browsing the code

Because a widget is just a zip package of HTML, JavaScript, and image files, you can unzip this example and browse the sources to get a feel for how widgets are put together, and how they are coded.

The HTML pages and the JavaScript are fully commented to help you understand basic widget functionality.

The widget is intended to demonstrate:


  • Widget structure and organisation
  • How to make HTML elements respond to user actions using onclick
  • How to dynamically switch a complete local HTML page
  • How to update and display specific content in a local HTML page
  • How to launch a network request using XMLHttpRequest, return data from a URI, and display it within the widget view

A more complete guide is in preparation. 
 

File Attachments


 



 

go top