dotMobimobiThinkingmobiForgemobiReadyDeviceAtlasfind.mobigoMobi

Using DeviceAtlas data

Many of you will want to use DeviceAtlas data in your own application. For instance, the data can be used for performing content adaptation of your mobile web site. And that requires you to download software and data to your local environment.

There are two elements to these downloads: a programming interface that can be used to conveniently access the data, and the device data itself, in the form of a single file.

The two elements are split out partly because of the rate of their change (the APIs change occasionally, and the device data changes rapidly), but also because the subscription to the data updates is subject to licence.

More information on downloading these components is available on the downloads page.

Each API provides a number of programmatic methods for accessing device data in response to an incoming request from a mobile device. Currently, our recognition algorithm relies on the user-agent HTTP header that comes from the device, and in return the API will indicate the specified property.

So, for example, if your application had loaded up the local device data and a mobile device accessed it with the user-agent header SonyEricssonZ800 which you placed in a variable called 'ua', you would be able to query its screen size from the DeviceAtlas data thus:

int width = Api.getPropertyAsInteger(data, ua, "screenWidth");

The API would tell you, quickly and simply, that the screen width for this device is 176 pixels. You would then be able to adjust the layout of your pages or graphics accordingly.

You can also access all of the properties about a given device as an associative array:

HashMap properties = Api.getProperties(data, ua);

(These examples are Java, but equivalent methods are available in all languages supported by the APIs)

Yes, it's as simple as that.