tags:

views:

219

answers:

1

I'm puzzling my head as to how some application appear to support the couple of Rotational Sensor APIs for Symbian, specifically the Sensor API and the Sensor Framework (both the 5th ed. and the 3rd ed. FP2 backport).

For example, I believe that Gravity will support rotation in N95 and also newer models from the same binary (could be wrong there...).

If I use the Sensor Framework then my app will not install on an N95 (it gives me a System Error -1), whereas if I use the Sensor API (RRSensor) then it will only install on an N95 and no other phones. This is most likely due to the available libraries on those devices.

I am trying to find some way of abstracting things such that I can use exactly the same binary for all devices. The only alternative I can see is trying to use ECOM plugins and then installing the relevant library using conditionals in my PKG file.

Does anyone know of a better/easier way?

+2  A: 

If you need to use different APIs, I suggest making multiple DLLs that implement the same interface and selectively install them to device depending on device ID. SIS files allow that.

Teknolog
Yes, that sounds like it might work - do you have an example of how I could check for N95/N82 specifically? The documentation on these Macros is quite hard to find.
magicbadger
If you have specific devices that are exceptions to the common case you can use the device ID to detect them.
Ola
Thanks I'll have to try something like that. For anyone else interested, a list of Product ID and Machine UID can be found here:http://wiki.forum.nokia.com/index.php/S60_Platform_and_device_identification_codesOh, and you can check for machine uID in the PKG file by doing: IF (MachineUID=0x20000600) OR (MachineUID=0x2000060B) "\epoc32\release\armv5\urel\mydll_3d" -"!:\sys\bin\mydll.dll" ELSE "\epoc32\release\armv5\urel\mydll" -"!:\sys\bin\mydll.dll" ENDIF[http://wiki.forum.nokia.com/index.php/Advanced_Package_File_Options]
magicbadger