ThinkDigit Home
Subscribe to the Newsletter
Search
 
SKOAR!       / SHOPPING
 
 
News / Features / Downloads / Channel 5
 
 
Creating a cross-runtime Twitter desktop widget
 
Posted by
Kshitij Sobti
1
314
Posted on: May 31, 2010 14:49:12 IST

 
 
 

The concept of widgets is becoming increasingly popular, on both the desktop and web. Widgets usually provide a rich graphical interface for small features which often do not deserve a full fledged application installation.

In UI programming terminology, any interactive reusable element of an application. Such a widget could be anything from a simple button or checkbox to a complicated interactive graph or 3D figure. Web or desktop widgets are applets (mini applications) which display some information, such as CPU or hard disk usage, weather or showcase an RSS feed etc.

While it is quite possible to create a widget using low level languages, it is often better to utilize one of the widget platforms out there. Windows itself now includes a Widget platform in Windows Vista and 7, however it is not cross platform. The good thing is though that some of the most popular widget engines all use the same languages for widgets, so creating a widget as simple as an RSS reader and porting it to multiple widget engines is not too difficult. The engines themselves may not be cross-platform, but the widget code can be.

All of Windows Gadgets, Google Gadgets, Yahoo Widgets, and Opera Widgets are written in JavaScript! In fact, even the Plasma widget platform on KDE for Linux can use JavaScript. What this means is that you can in the least reuse pieces of the same code across all of them. Better still, widgets for the Windows platform, Opera platform, and KDE Plasma can all be written in web technologies such as HTML and CSS for the presentation bit, so if you don’t use any platform specific features you can run the same code in both with minimal modifications. Google and Yahoo’s widget engines both use a custom XML dialect.

Creating a simple widget which displays the RSS feed for a website is a simple job. In fact Opera Software provides what it calls the “Widgetizer” which can take an RSS feed, and output a widget which will run on Opera’s own runtime.

To start creating widgets it is important to have basic knowledge of web developmenat technologies. Once you are done with a few tutorials on HTML, CSS and JavaScript -- and such are available at http://www.w3schools.com/ -- you only need to learn some of the features specific to the API provided by the widget runtime you choose to use.

The good thing is that since Opera and Windows both use HTML + CSS + JavaScript for creating Widgets, you can kill two birds with one stone. Since the Windows gadget platform uses Internet Explorer 7 for rendering the widgets, it is important that you design your widget with Internet Explorer in mind.

Each widget runtime will offer some specific features which give the widget greater access to the system than a webpage would normally have. However, using these features will make the widget difficult or impossible to port to all widget platforms. It is not suitable for all kinds of widgets.

Our example for an RSS feed widget is however very simple to port between platforms since it doesn’t need to use any specific features. Think of it this way, any web application which can run on IE7, WebKit and Presto can be made into a cross-platform, cross-runtime widget.

Now on to the widget itself.

    
Next >






 
 
 
Latest Features
 
 
 
 
Comments 1comments
 
Posted by Zeeshan on May 31,2010
 
We did a very custom Windows 7 Gadget , see wcities.com , however the kde plasma tutorial is very helpful. Thanks.
 
 



 
 

 
 
 
 
Newsletter Subscription
 
 
 
 
 
 
 
 
 
 
 
 
 
 
http://devworks.thinkdigit.com