Android Applications

OldTracks

A developer application for injecting mock location events.

  1. Go to Settings -> Application -> Development and check the 'Allow mock locations' option. This allows applications (OldTracks in our case) to create a test location provider and inject mock locations.
  2. Make sure that you have a GPX file containing the recorded trace that you wish to replay. One way to do this is to use the 'My Tracks' application (which you'll find on the Android Marketplace), record a track and write it to the SD card in GPX format.
  3. Open the OldTracks application, press in the text box for GPX File and browse to your chosen file.
  4. Play back speed is controlled by the Speed slider which sets the multiplier on the playback rate. (1.0 is normal speed).
  5. Once you have started playback using the Start button you can use the View button to view the playback locations on a map overlay.

To receive these events in your application you need to request location events from the 'OldTracks' location provider. I use the following code to do this:

String provider = LocationManager.GPS_PROVIDER;
if (mLocManager.getProvider("OldTracks") != null) { provider = "OldTracks"; }
mLocManager.requestLocationUpdates(provider, 0, 0, mLocListener);

Comments and feature requests welcome.

Other Applications

We've developed a number of Android applications as part of our Undergraduate Summer Programme. You can find more information here.