Is the bearing returned by the accelerometer the way to go, or it’s better to use the one GPS service returns?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Accelerometer + magnetic sensor is definitely the way to go. GPS service does not return bearing if the device is static. The
getBearing()method only returns something if the device is moving. As stated in the documentation,hasBearing()typically returns false.In fact, the word bearing is quite dangerous when used in these contexts, because the bearing from the accelerometer is understandable as the direction the device is facing, while the bearing from the GPS service is the direction alongside the device is moving.