views:

1013

answers:

5

Say you have a Windows Mobile 6.0 phone that also has a GPS receiver. Does the WinMobile SDK support accessing GPS functionality?

If not, what are the options (API) for programming with the GPS i.e write apps that will use the GPS capability. I am mainly interested in Windows Mobile 6.x but please do include generic replies also.

I will surely vote for the most helpful answers.

Thanks in advance.

+3  A: 

If you are planning to develop in the .NET Compact Framework, there is a quite extensive GPS example in the Windows Mobile Developer Samples. That basically makes use of wraps around gpsapi.dll but it shows the works. I have installed the WM6 kit in C:\Program Files\Windows Mobile 6 SDK and the GPS sample is then in C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS

Good luck!

LocalJoost
The "Mobile Development Handbook" by Wigley/Moth/Foot (http://www.amazon.com/Microsoft%C2%AE-Mobile-Development-Handbook-Wigley/dp/0735623589) includes a variation on the example code for later versions of the .NET Compact Framework that have improved interop support.
peSHIr
+6  A: 

Two options:

  1. There is the intermediate GPS driver, which has a howto article for .Net on MSDN
  2. You could connect to the serial port (configurable in UI, of course) and parse the NMEA strings yourself

Option (1) is probably advisable

Rowland Shaw
+4  A: 

Chris Craft had a lot of source code for this sort of thing in his Series **30 Days of .NET [Windows Mobile Applications]"

  • Week 1 - Including GPS Compass
  • Week 2
  • Week 3 - Including GPS Speedometer and GPS Altimeter
  • Week 4 - Including GPS Clock

There's also some notes on using the Intermediate GPS driver on Raffaele Limosani's blog


Edit to add:

GPS.NET has recently become open source, and is now available on CodePlex:

GPS.NET 3.0

Zhaph - Ben Duguid
+1 for GPS.NET 3.0 link. I need to check that one out!
peSHIr
+2  A: 
Allan Simonsen
+1  A: 

And for testing code that uses the intermediate driver (see other answers), don't forget the FakeGPS utility from the SDK that you can use to pipe a NMEA stream stored in a file through this intermediate driver so you can easily test GPS software on that location data without actually having to have GPS reception and start moving around.

peSHIr