4

I have a problem with the Android emulator. I am creating an app which uses location in order to register tracks etc. The problem is: when I load a GPX file in Extended controls of the emulator, locations are not sorted correctly thus the man on the bike jumps from his usual route to the completely different part of the route.

enter image description here

The red line is the registered track. It has one big fluctuation and then returns to the normal route. In the "Extended controls" window you can see that in the "Name" column there is a number 62 even though the others are numbers from 55 to 49 listed in order. There are plenty of those "number jumps" in the entire column.

My question is: can I somehow set an order by name in extended controls? Even then, how about other GPX files which don't have included "name" parameter? Maybe I should change something in the GPX file? Or load it differently?

Kilian Stinson
  • 2,376
  • 28
  • 33
Fajeczny
  • 41
  • 1
  • 4

2 Answers2

2

Here's one workflow to workaround the ordering issue - this approach adds the ordered timestamp as mentioned in other answer by @Miq.

  1. Generate path using google maps and export URL (or upload existing gpx file).

  2. Use GPS Visualizer ( http://www.gpsvisualizer.com/convert_input ) to convert to GPX (paste URL into the field 'Or provide the URL of a file on the Web:' and use the advanced option 'Add artificial timestamps (for OpenStreetMap import):'

  3. Press the convert button and paste the output into an editor for saving locally.

  4. Load file using Extended Controls - Location.

The ordered timestamps does the trick to maintain path order. The actual timestamp values are not important, just the relative order.

1

There's no way of sorting given locations in emulator. If your GPX file provides <time> element, loaded points are sorted according to that value plus delays are added. However this parameter is optional, so in that case emulator should load it in file order, but it doesn't (as you noticed). It seems that it is a bug in Android emulator - points from KML files are loaded in order. As for now, convert your GPX to KML format or check if your device can provide time entries.

Miq
  • 3,931
  • 2
  • 18
  • 32