ayoola-solomon / mytracks

Automatically exported from code.google.com/p/mytracks
0 stars 0 forks source link

Option to rotate the map based on compass direction #650

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. View the current position in the normal (upright) display orientation.
2. Hold the device so that the display points straight up. Turn around, and 
watch the bearing arrow rotate.
3. Turn the display to landscape or upside-down mode. Repeat the turning 
exercise.

What is the expected output? What do you see instead?

I would expect the compass arrow to point to the direction that corresponds the 
current (rotated) top of the display. It seems to be corresponding to the 
physical top of the screen (the end of the device where the earpiece is 
located).

What version of MyTracks are you using? On what version of Android? On what
phone?

MyTracks 1.1.11 on Android 2.3.4, SonyEricsson Xperia Active (ST17i).

Please provide any additional information here:

The electronic compass is very useful orientation aid when you have just exited 
a building or a subway train (maybe no GPS fix yet) and want to know which 
direction to start walking. It is confusing if the arrow direction is relative 
to the physical rather than the logical top of the screen.

Original issue reported on code.google.com by msmak...@gmail.com on 9 Dec 2011 at 5:22

GoogleCodeExporter commented 9 years ago
I've confirmed the same problem with MyTracks 1.1.16 (on Acer Iconia Tab A100 / 
Android 3.2.1), and made a quick fix for this at 
<https://code.google.com/r/ssssonik-mytracks-fix-issue-650/>.

This fix checks the rotation of the display every time the heading value 
changed,
but it might not be necessary because Activity is re-created when the rotation 
changes.

I would appreciate your comments on this fix.

Original comment by sss.so...@gmail.com on 4 Jun 2012 at 9:25

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 22 Jun 2012 at 12:41

GoogleCodeExporter commented 9 years ago
I did some research. Since Sensor.TYPE_ORIENTATION is deprecated,
we should use SensorManager.getOrientation instead. See

http://stackoverflow.com/questions/8734190/android-compass-example

I will try using SensorManager.getOrientation and see if it fixes this bug.

Original comment by jshih@google.com on 3 Aug 2012 at 12:35

GoogleCodeExporter commented 9 years ago
> Since Sensor.TYPE_ORIENTATION is deprecated, we should use 
SensorManager.getOrientation instead.

Right.

But using SensorManager.getOrientation() alone is not enough.
See 
<http://android-developers.blogspot.com/2010/09/one-screen-turn-deserves-another
.html>.

We should (1) use SensorManager.getOrientation() instead of 
Sensor.TYPE_ORIENTATION, and (2) compensate for the device orientation using 
Display.getRotation() and SensorManager.remapCoordinateSystem().

I'll try these.

Original comment by sss.so...@gmail.com on 3 Aug 2012 at 4:10

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 10 Nov 2012 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 10 Nov 2012 at 6:53

GoogleCodeExporter commented 9 years ago

Original comment by jshih@google.com on 28 Feb 2013 at 12:34