Use this project to simulate GPS while doing development on your Windows Phone 7 emulator or device.

If you are developing an application that uses the GPS it is somewhat difficult to test this on the emulator since there is a lack of support for simulating the GPS. Even if you are doing development on the device, you may need to get a series of readings to test your software. This project which includes a single C# file that you include in your project as well as a Silverlight Route Builder (on this page) can be used to simulate the GPS.

Usage Instructions:
  1. Download FakeGPS.cs and include it in your project.
  2. Use the route editor below to build a simulated route you wish to play back on the device
  3. Press "Copy to Clipboard"
  4. Paste the Route XML into FakeGPS.cs replacing the existing XML assigned to ROUTE constant in that file.
  5. Where you perviously declare GeoCoordinateWatcher in your applications code replace it with a declaration of IGeoPositionWatcher<GeoCoordinate>.
  6. Conditionally instantiate either GeoCordinateWatcher or a WolfBytes.FakeGPS instance.
  7. Use your GPS like you normally would.

IGeoPositionWatcher _watcher;

public MyClass()
{
     if (System.Diagnostics.Debugger.IsAttached)
          _watcher = new WolfBytes.FakeGps();
     else
          _watcher = new GeoCoordinateWatcher();
}


Application Usage:
  • Total Run Time - The total time in seconds from the first way point to the last way point
  • Update Interval - The number if milliseconds between updates between PositionChanged events from the GPS
  • Pause Before Start - The number of milliseconds between invoking the start method on the FakeGPS and the first PositionChanged event.
  • To add way points, click on the map.
  • To remove a waypoint, click on that way point
  • After you have built your route, click on Copy to Clipboard and paste those values into the existing ROUTE string constant within FakeGps.cs

You need to install Microsoft Silverlight to view this content. Get Silverlight!
Get Microsoft Silverlight


Last edited Dec 7, 2010 at 12:06 PM by kevindwolf, version 14