Hi,

Have a look at: 
http://www.coderanch.com/t/437758/Android/Mobile/G-Magnetic-Detection

and change the OnResume as follows:

# mSensorManager.registerListener(mListener,
#                 SensorManager.SENSOR_ORIENTATION,
#                 SensorManager.SENSOR_DELAY_GAME);

# mSensorManager.registerListener(mListener,
#                 SensorManager.SENSOR_ACCELEROMETER,
#                 SensorManager.SENSOR_DELAY_GAME);


Then explore

http://developer.android.com/reference/android/hardware/SensorListener.html#onSensorChanged(int,%20float[])

and

http://developer.android.com/reference/android/hardware/SensorManager.html

to help you in your calculations.

Good luck

Cass

On Apr 13, 5:11 pm, developpeur <[email protected]> wrote:
> hi everybody
> i have a question about theaccelerometerintegrated into new mobiles.
> i want to know how it work? if possible a sample android code that
> demonstrate how to use the package
> android.hardware.sensormanager to manipulate theaccelerometerand get
> the followings results :
> the actual direction of the mobile (vertical, horizontal) ?
> the actual mobile's orientation ( mobile is turned left, right, ...)
>
> waiting from you any response.
> thank you.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to