Android Question orientation and sensors

sorex

Expert
Licensed User
Longtime User
Hello,

I wonder if someone have a solution for the following...

when using the rotation sensor I get a rotation value between -89 & +89.

this looked very usefull but at a deeper look it's not usefull at all.

let's say your base orientation is portrait | ^ (^ marks the top of the device)

when you turn 45° right to / ^ or even further to 135° \ v
the returned value are exactly the same (-45 or something)

the mirrored positioning ( v / & ^ \ ) gives positive values tho but then you still don't know everything to get the right orientation.

how can I tell in which (approx.) orientation the device is?
 

sorex

Expert
Licensed User
Longtime User
forgot to mention that I read out the 3rd value, the first value seems to go from 0 to 360 but when putting the phone at | ^ it gives 300
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
bizarre...

when I put the phone straight up in portrait the values are right now (with some math)

BUT

when I just turn the phone around while still standing straight up the X values starts to change aswell?
 
Upvote 0
Top