[GIS] How to decode GPS coordinates from Android device XML file

androidcoordinatesgps

I’d like to decode the location coordinates from the XML file from my Android phone (SGS2). Any solution how to do it, how to convert them to usable coordinates (longitude/latitude)?
Looks like it's base64 encoded. from there, no idea.

<string name="lastPosition">wLphlm9S56tDr+Ruft1URA4iubjA111HfIdVuhw3cC8=</string>

Full XML example:

<map>
 <string name="lastPosition">1j+wY60EYdawR3UTnoSsbAcGWRDIlNTCd0j3zXZO1D4=</string>
 <int name="deviceTag" value="1118448321"/>
 <long name="locationReportingIntentTimstamp" value="1363120660401"/>
 <float name="lastAccuracy" value="759.0"/>
 <boolean name="locationHistoryEnabled" value="true"/>
 <long name="lastTimestamp" value="1363121442835"/>
 <long name="lastIntentProcessedTimestamp" value="1363121443003"/>
</map>

Best Answer

This looks like an encoded polyline to me - for the algorithm to encode/decode, see:

https://developers.google.com/maps/documentation/utilities/polylinealgorithm

Google also has an online tool that can encode/decode:

https://developers.google.com/maps/documentation/utilities/polylineutility

As you noted decoding your polyline seems to result in locations off the coast of Africa:

enter image description here

Judging by the lastTimestamp in the XML file (and assuming this is UTC in milliseconds), these locations were recorded back in 2013 (Tue, 12 Mar 2013 20:50:42 GMT to be exact). So, this data may not be valid tracking data.

I know manufacturers have gotten in trouble in the past over logging device locations to system files as part of the device development process, and then they forget to remove/purge these files before the software is launched to production. My guess is that this file is a leftover debug file from Samsung's internal software testing with the Galaxy S2.

Related Question