Tuesday, November 24, 2009

The Widget Specifications

The buzz word is Widget these days. I have been working in widget world as part of my Job. Recently W3C has come up with Widget specification and i thought to drill down into its details. Here are few things I could get from my readings.

The first eye catching point was w3c definition of what is a widget.

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

As of this writing there are many Draft documents related to Widget Specification. The documents are mainly the followings
  • Device API requirements
  • The Widget Interface
  • Packaging and Configuration
  • Widget URIs
  • View Modes Media Feature
  • Access Request Policy
  • Digital Signatures
  • Requirements
  • Updates
  • The Widget Landscape
The Widget Landscape
The first draft document i selected to read was the Widget landscape http://www.w3.org/TR/2008/WD-widgets-land-20080414/

The following are the items W3C has attempted to point out in this. Overall, this draft is a result of market research on leading widget user agents. The survey exposes the commonalities and fragmentation across various user agents and how fragmentation currently affects among other things, authoring, security, distribution and deployment. The document then concludes by making a set of recommendations on what aspects of widgets require standardization to reduce the fragmentation to ultimately standardize a cross-platform widget solution.

The following are the areas the survey investigates to see how various user agents address these areas
  • distribution and deployment
  • meta data and configuration
  • user interface and accessibility
  • authoring
  • internationalization and localization
  • device independence
  • initialization
  • automatic updates
  • security
Distribution and deployment:
The main issues related to this is the lack of standardization in
- file extension of a widget. Some user agents accept zip file, others accept .widget, .gadget etc.
- It is not mentioned exactly which part of widget specification user agents should support. The compression method chosen need to be standardized.
- The media type of widget is not standardized yet. This makes the widgets transfered over http associated to one widget engine. One media type for widget user agent makes vendor lock in.

Meta Data and Configuration

For almost all types of widgets, the meta data and the configuration file parameters are given below.

The major Meta data elements are
- Root element
- Unique identifier
- version identifier
- description
- copyright
- authorship

The major configuration elements parameters for a widget are
- Bootstrap ( a way to identify the start file)
- network (the need for network access)
- width and height (the initial rendering dimensions)
- plugins (the intention to use plugins)
- Platofrm (minimum version of the widget user agent required to run the widget)

Most of the widget specifications use XML to specify the metadata and configuration parameters. Opera and Apple widgets does not have the file name extension as .xml, instead it is .plist. The vocabulary that defines the semantics and rules for the widget configuration file is proprietary. Due to this the following are the interoperable issues.
  • The XML vocabulary is different. Different semantics exist for the widget configuration files.
  • The XML parsers are generally non conformant to XML and XMLNS specifications. (Authors currently not required to specify the XMLNS for the configuration document)
Authoring and Scripting
Most of the user agents support the following
- http.
- IRI
- Unicode
- ECMAScript
- DOM
- Ability to render markup languages such as HTML, CSS
- Also support multimedia assets such as images, sound, even video also.
- Due to increase in popularity of Ajax style development, the UAs also support XMLHTTPRrequest or some similar mechanism for asynchronous communication over http.
- Many UA support APIs for authoring and few specific to widgets

The inter operable aspects in Authoring are mainly the below.
- All user agents support XMLHttpRequest
- All but one support HTML & CSS as layout
- There is some limited fragmentation due to the support in some user agents for proprietary technologies such as flash.

Apart from the above, Most of the UAs provide APIs, Events, and properties to the running widgets. Below section gives the comparison of these items across different user agents.

The main API user agents provide to widget is opening a web document in a system browser. Various user agents provide their own API signature for this. some are given below.

Confabulator - openURL
Joost Widgets - navigate(String url)
Also there are other APIs that allows widget to access lower level system commands and open applications.

CommandObject widget.system.execute(String command, [function callbackhandler]);
void widget.openApplication(HexNum Id,String params);


The main properties are widget.version, widget.author,widget.copyright, widget.visible.

The main events given to widgets are widgets.onLoad, widgets.onGainFocus, widgets.onLoseFocus, widgets.onMouseDrag, widget.onUnload etc.

There is one event for Cross communication of widget widget.onTellWidget = function() {} - This could not really understand the syntax of it. Need to update this section

The dockOpen, onDockClosed, onDocOpend, onPreferencesChanged, onRunCommandInBgComplete, onScreenChanged, onWakeUpFromSleep, onWillChangePreferences etc are some other regular events passed on to the widgets.


User Interface and Accessibility
This mainly compares the standards for displaying the content and how user can interact with the content. Except the Google gadgets, the mechanism for displaying the content is HTML, CSS and ECMAScript. For google gadgets, it is propertary XML. Yahoo widget as well uses proprietary XML to represent the data. However it supports HTML, CSS as well.

Instantiation
This section talks about the way the user agent address the resources in the widget to display the initial page of the widgets. Many user agents employ a static file with the name index.htm etc. Apple Dashboard uses tag which specifies the start page.

Internationalization and Localization
Internationalization refers to technical aspects that allow a widget to work in multi lingual environments without making significant engineering changes to a widget. "Localization is the process where by a widget is adapted to use a local convention of particular end users.

One way to do this is to place the locale specific resources inside specifically namesd folders. say en-au. If the user agent can identify the locale and there is matching folder found, the localized widget will be presented to the user.

Another way is to have developers specify the localized strings inside specifically named text file which in turn will be placed inside the specifically named folders. e.g. en-au/Localizable.Strings. Inside the file, the localizable strings are identified by a unique identifier. Say for example, the text file can contain

"greetings" = "g! day mate!"

This can be accessed within the code by the function widget.getLocalizedString("greetings");




Wednesday, November 11, 2009

Just on a Touch! - Mobile Phones with Touch Screen

Am pretty late to blog about the touch screens - Almost 1 year! As part of my job, i had to investigate few behaviors of touch UI. When decided to get into the details of touch UI, the first thing came in to my mind was my iTouch. It works great for me unlike one another touch phone I have. I digged few details from How Stuffs Works.com to figure out the inner working details of iPhone Touch. The following are the facts i got from the site.
  • iPhone Employs Capacitive touch technology and has a new arrangement of the capacitors compared to other devices. The capacitors arranged according to the coordinate system. Its circuitary can sense the change at each coordinate along the grid and generates its own signal. These signals are relayed to the processor and the processor software is able to determine the movement and location of simultaneous touches in multiple locations.
I became more curious to know how the underlying hardware work in various technologies to make this all happen

Capacitive Touch Detection
A basic capacitive touch panel consists of an insulator such as glass coated with a transparent conductor such as indium tin oxide (ITO). As human body is also a conductor, touching the surface of the screen results in distortion of the local electrostatic field, measurable as a change in capacitance. Different technologies may be used in determining the location of the touch.

I got an image from one another site that explains the capacitor creation and some more explanation of it.
The ITO layers are sealed between two glass sheets. The patterns on the two ITO layers form a grid of capacitors. The electric field of these capacitors are projected through the top layer of the glass. When user places a finger near the top surface of the touch screen, it couples with the electric fields. This coupling changes the capacitance of several of the capacitors in vicinity of the finger. An algorithm converts these changes in capacitance into a location along the X and Y axes of the screen.

Surface Capacitance
In this basic technology, only once side of the insulator is coated with a conductive layer. A small voltage is applied to the layer resulting in a uniform electrostatic field. When a conductor such as human finger touches the uncoated surface, a capacitor is dynamically formed.

SideTopics
While browsing through various sites, found an amazing link at http://multi-touchscreen.com demonstrating multi touch interface.

Some Extra Items
  • ITO is used because the substance is a transparent conductor. The dielectric to form a capacitor is actually air it looks like.
  • Touching the screen with a thick glove will not cause the change in the electric field and hence the capacitance will not vary and because of this, the touch sensing cannot be done. Usually in such situations, the sensitivity of the screen will be increased.

Tuesday, November 10, 2009

Samsung bada - One another platform


It was quite surprising when saw the news on Phonescoop about Samsung new Mobile platform bada. Here are the few details could collect from internet about this.
  • It is a New Mobile platform newly introduced by Samsung - But open to world
  • Developers can write applications on it with some level of device access
  • SDK to be released on early December
Marketing Strategy

Looks like the marketing strategy is around developer community. The SDK is planned to be released early in december and developer contests are being organized. The strategy appears to be pretty much like any other new platform being introduced to the market. The concept will probably penetrate a mass market because of the fact that the platform is targeting the phones those are less than smart phones. More applications to regular feature phone users. However, it looks to be more than a feature phone because of the fact that they are targeting the touch devices as well. The platform entering to the market in a touch phone.

The following are the questions shooting across in mind when read few things about the Bada OS/platform. The questions to be answered when the platform is launched.
  • How open the platform is? - In otherwods how much touch of proprietariness in the platform? Heard that it is based built on top of Linux
  • How to code on this platform? Do they support multiple development languages?
  • How the app store will be? - Apps can be downloaded outside app store? - or a closed box?
  • How can user submit applications?
  • Developer need to have paid account to develop apps?
  • Will it co-exist with other platforms? such as Brew/Java ME?
  • Does this platform support widgets?
  • How long the platform will be in its infancy ? - Do they have enough armory in the first version or they are planned to be added in its evolution?
  • Who will be the most biggest defender for this platform
  • Why don't Samsung go with Android platform? - From a few blogs, read that Bads OS should stand alongside Android in company's portfolio.
  • What would happen to LiMo? - Samsung is actively a part in LiMo foundation along with other OEMs as of now.
Need to wait and see what is in the box!

Although some of the predictors already said Samsung entry into the market is little late when there are many platforms such as Android, RIM and Nokia Shore up its smartphone business with its Meamo devices in market. Undoubtedly competition will be fierce.

Sidebar, Samsung plan is to have the Bada as its primary target in coming years. The below graph reflects it. (source: gsmarena.com)















11/16/09 - Just assured once again that Bada is not an OS. But it is a software layer Samsung has added to its existing proprietary OS allowing thirdparty application developer to develop apps for this platform. Bada Can also run on top of Linux. The reason Samsung wanted to have such a platform is because Samsung realized that a smartphone cannot exist without lot of applications.

11/22/09 - a much valuable information on this stuff got today. According to ROA group, a mobile industry consulting company, bada is a customized version of Nucleus OS which is a real time OS developed by mentor graphics. Samsung has renewed the license contract with AT Korea, the reseller of Mento graphics. They enhanced RTOS and its UI framework to enable application installation and operation. It has ability to change feature phone to smartphones.

Another interesting fact is that Samsung has been using Nucleus OS in good number of already existing mobile phones including the multi-million seller samsung jet. There are some advantages using Nucleus OS. It allows multitasking capability and having Touchwiz UI running on the OS.