Hi All,

I´m implementing a simple application that prints on the screen
"Right" if i shake the device to the to right and prints "Left"
otherwise. It was working fine till I tried to incline to one of the
two sides. It remained printing "Right" indefinitely because the x
axis acquired the gravity acceleration, that is about 9,8m/s².

>From the: 
>http://developer.android.com/reference/android/hardware/SensorListener.html#onSensorChanged(int,
float[])
I got the following note:

IMPORTANT NOTE: The axis are swapped when the device's screen
orientation changes. To access the unswapped values, use indices 3, 4
and 5 in values[].

Based on this NOTE i tested my application with the 3 value (http://
developer.android.com/reference/android/hardware/
SensorManager.html#RAW_DATA_X) BUT
all I got was ArrayIndexOutOfBoundsException!!!

Anybody has any clue about it?

Thanks in advance.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to