Code Painters The Art of Coding


Symbian accelerometer APIs – part I

Using the accelerometer sensor in the Symbian applications is not particularly difficult, however things are getting much more tricky if the older S60 editions have to be supported. The good point to start is this page, but it doesn't really cover all the necessary details.

Different phones, different APIs

The first annoyance is the use of two different APIs for older and newer S60 editions. Older Nokia phones use Sensor Plug-in API, while the Sensor Framework API is used starting from S60 3rd Edition Feature Pack 2.

S60 3rd Edition

There are only two S60 3rd Edition devices with accelerometer sensors: Nokia 5500 Sport and N93i, both using Sensor Plug-in API.

S60 3rd Edition Feature Pack 1

There are also only a few S60 3rd FP1 phones with accelerometer: Nokia N95, N95 8GB, N82, all using Sensor Plug-in API. There is one exceptional phone, Nokia E66 - the only pre-FP2 phone using Sensor Framework API.

S60 3rd Edition Feature Pack 2

The following Nokia S60 3rd FP2 phones include accelerometer sensor: X5-01, E73 Mode, 6700 slide, E72, E52, 5730 XpressMusic, N86 8MP, E55, 6720 classic, E75, 6710, N96-3, N85, N79, 6210 Navigator, N96. All these devices use Sensor Framework API.

S60 5th Edition

All S60 5th devices are equipped with accelerometer sensor. Needless to say, it is a standard equipment these days ­čÖé Of course, all the S60 5th Edition devices use Sensor Framework API.

Other manufacturers

To make things even more confusing, there is one more API, GSensor API used exclusively by Samsung for its Symbian-based devices. Appropriate SDK extension can be downloaded from Samsung.

Packages to install

Before S60 5th Edition the libraries were not part of the SDK, so it is necessary to download and install one (or both) of the extra packages:

It becomes confusing as soon as you try to find the API package for 3rd Edition Feature Pack 1 SDK - there is none. If you want to use Sensor Plugin API with Feature Pack 1 SDK, you have to install the package intended for the 3rd Edition. Obvious, isn't it?

To make things even more confusing, the API package is distributed as a Windows installer (exe) file, which permits the package to be installed only into one SDK among those installed on the PC:

It becomes a problem if you want to develop using both 3rd Edition and 3rd Edition Feature Pack 1 SDKs. The best way to overcome this problem is to install the package into one SDK and manually copy the headers and library files to another one. The files to copy include:


Starting with S60 5th Edition the Sensor Framework API headers and libraries are part of the SDK, there's no need to install any extra package.

Phones without an accelerometer

It may sound weird, but phones not equipped with accelerometer become problematic when developing accelerometer-aware application. The application linked against Sensor Plugin API or Sensor Framework API libraries will not even start on the phone without an accelerometer.

The reason is simple - the sensor API is implemented as a static DLL (yes, the name sounds like a self-contradiction, but that's how Symbian guys call it, anyway). The application is linked against .lib file, which only defines the entry points to the DLL library which must be present on the target system. Apparently, the corresponding .dll file is not present on the phones without accelerometer, thus the application fails to load.

If your application can work without accelerometer (like mine), you need to prepare separate versions of your application for the phones with/without an accelerometer sensor.

What next?

In the next part I'm going to cover some basic usage of the sensor APIs, as well as to give some hints about processing of the sensor data.

  • Facebook
  • Digg
  • Twitter
  • LinkedIn
  • Google Bookmarks
  • Reddit
  • StumbleUpon
Comments (0) Trackbacks (0)

No comments yet.

Leave a comment

No trackbacks yet.