Device Capability Detection and Content Transformation

Wednesday, October 10, 2007 Labels: ,


In WAP sites there are two main issues which difficult the job of the developer to create a solution which is optimized and supported on large number of handheld device (featured phone, smart phones and PDA’s etc.).


1. Device Capability Detection

2.Content Transformation

Device Capability Detection

Today there are two major browsers versions in market for wap, i.e WAP 1.0 (WML supported) & WAP 2.0 (XHMTL-MP supported) . Now problem occurs, how can we know that certain device/user is using WAP 1.0 browser, WAP 2.0 browser or it is simply using desktop browser. It is important because a service provider always wishes to redirect a user to certain information/service according to device capability. Its the case when service provider decides to develop its services for wap also.

1st thing to be done is now to detect the device/user and made the decision for redirection. The redirection can be from web to WAP, or from WAP to web. It can also be from WAP 2.0 to WAP 1.0 or vice-versa. Its totally on your implimentation.

This distinguish b/w the handheld devices/browsers and desktop browsers is very easy. All you will have to do is to get the user-agent parameter from the requested side and redirect the user to wap/web site. This is done by reading the user-agent parameter. Now here starts the real game. How to detect and differnciate the handheld devices. e.g. the user access the wap.example.com. now how are service will know after getting the user-agent that its is WML suppoted handset/mobile (browser) or XHTML-MP suported mobile (browser). Here is the solution to this problem.

(i) WURFL (Wireless Universal Resource File)

The WURFL is an “ambitious” configuration file that contains info about all known Wireless devices on earth. Of course, new devices are created and released at all times. While this configuration file is bound to be out of date one day after each update, chances are that the WURFL lists all of the WAP devices.

You can think of the WURFL as a global database of all devices and their capabilities.
Of course, the wurfl is not all that there is to it. What you also need is a way to efficiently read the info from the database and use it in your applications to dynamically customize your apps for families of devices.

i recomend you people to user WURFL API for device detection. pass the user-agent to this api, it will return you a boolean telling weather this device is xhtml compatible or not and now u can make your decision.

here you can find more details:

http://wurfl.sourceforge.net/

(ii) UAProf (User Agent Profile)

UAProf (User agent profile) is an XML document that contains information about the user agent type and device capabilities. It is a standard defined and maintained by the Open Mobile Alliance (formerly the WAP Forum).


UAProf was created according to the CC/PP (Composite Capabilities/Preferences Profiles) framework with RDF (Resource Description Framework) as the schema. Both CC/PP and RDF were defined by the W3C (World Wide Web Consortium).


User agent profiles are stored in a server called the profile repository. Very often a profile repository is maintained by a mobile device manufacturer. For example, the user agent profiles describing the capabilities of Nokia cell phones are stored in a profile repository maintained by Nokia.


Note that not all mobile devices support UAProf and so you may not be able to find the URL of the UAProf document in HTTP headers. If the mobile device does not support UAProf, you can still find out certain information about the user agent using traditional HTTP headers such as Accept, Accept-Charset, Accept-Language and User-Agent.

2. Content Transformation

Content Transformation means sending a content to download on user request according to his/her mobile device specifications. It also can be a desktop pc.

As I already said about how to detect a device and explore its capabilities.

Now is the time how to send content to the user.

There are two ways to deliver content to the user.

1. You store your content in many formats and sizes, and when you check the capabilites of the device, after that you send him/her content which is most suiteable for his/her mobile device.

Benifits of the approach is its simpler and draw back is space acquired by content storage.

2. The more practical approach is Content-Transformation.  In this way you store the content(ringtones/wallpapers) in a standard format. e.g for wallpapers, you use jpg and mp3 format as standard.

RIngtones:

When you are dealing with ringtones, get the this content, if this format is not supported by the user device, convert it to other format using 2rd party tools or by you own code, e.g .mp3 to .amr and then send to the user. If the user supports the mp3, no transformation is needed and you can send him/her content directly.

Wallpapers:

In wallpapers, format doesn't matters much, but its dimensions. But sometimes both matter.  In this case, device resolutiion is checked for device requsting content, and then the wallpaper is re-sized according to the device resolution. Remember try to store your wallpaper content in larger dimension for better results.

1 comments :

ifuschini said...

I have published the new version of Apache Mobile Filter, now the filter is give to you the information of capabilities as apache environment.
Now you can develope in any language (php,jsp, ruby etc.) and have the information of mobile capability.


Read more info here: http://www.idelfuschini.it/it/apache-mobile-filter-v2x.html

Post a Comment

 
Waqas Sadiq © 2014