Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Super Contributor
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Find a tilt angle using accelerometer reading in blackberry



I want to find tilt angle using accelerometer reading i get from the blackberry devices.


I used below formula to find out angle in Blackberr 10 but in BB10 reading is different then Blackberry java.




float root = sqrtf((x * x) + (y * y) + (z * z));

float finalAngle = round(180 / 3.14159265358979323846 * acos(y / root)) - 90;


now i want to find this on Blackberry JAVA.

here x,y,z value is different so is this formula work?