views:

29

answers:

1

Hi, I am migrating from Symbian to Android. For symbian based nokia mobile phones, the support for accelerometer sensing using java is by the Mobile Sensor API (JSR 256) which is provided in the technical specifications of every nokia mobile phone that supports it.

However, for Android based "HTC Desire" mobile phone, I am not sure whether the HTC mobile has to provide for sensor APIs or whether the mobile's support of Android 2.2 is enough to get java code to access the mobile's accelerometer data. Please advise.

To be more specific, I was thinking of writing a java application that uses the accelerometer to act like a wireless mouse for a PC. And then add some extra functionality to it to serve as a general purpose pc controller that takes the z axis into consideration apart from the standard x-y axes the mouse uses. For this, should HTC provide for any APIs to access accelerometer data? If so, what APIs? or is HTC's Android 2.2 enough to achieve this feat? Please advise. Thank you in advance.

+1  A: 

Android provides an API to access the accelerometers of all Android devices (see here: http://developer.android.com/reference/android/hardware/SensorManager.html), and there are lots of examples on how to use it. This has nothing to do with HTC.

EboMike
Thanks for the link and thank you very much for such an early reply.
Srikanth
No problem. The sensor manager may seem a bit weird at first, but once you get the hang of it, it's easy. I would recommend googling for examples on how to use it.
EboMike