Reputation: 6182
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.
Upvotes: 4
Views: 3970
Reputation: 26956
Chris Craft had a lot of source code for this sort of thing in his Series 30 Days of .NET Windows Mobile Applications
Sadly this blog series appears to have died, but thankfully the code is preserved on Codeplex:
And a port to C and some discussion around some of the original posts can be found on /dev/mobile
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:
Upvotes: 5
Reputation: 1238
Try to have a look at some of the solutions on CodeProject.com. There are a lot of very good articles about Windows Mobile and GPS.
Upvotes: 2
Reputation: 1183
From my point of view it is much easier to read serial port (in my case COM5, baudrate 4800) and parse received data. (how to parse the string can be found via Google and phrase: gps NMEA sentences)
For me is impossible to understand the example on address:
C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS
It is all so complicated and unstraightforward. I would expect much easier and usefull interface like:
myGps = new GPS()
myGPS.getPosition
But this is probably not possible :(
And how to do it via RS232? (I work in VB.NET)
In GUI (or programatically) create object System.IO.Ports.SerialPort and use its event DataReceived. Whenever data come from GPS, this event occures and in it's body you can process it.
Data is in format of a loooong string devided into sections $GPGGA, $GPGSA etc. Important is $GPGGA. Each particular information is delimited by comma. Than you only parse this string - in VB.net using: myArray = myData.Split(","c).
PS: ","c means that the comma is ment as a Char, not String (VB.NET)
As you can see there is no need to write more than a few lines of code. Example by MS is needlessly difficult and is not for beginners.
PS2: Note that you do not send any commands to GPS. It automatically and periodically sends data to your program. You just open port, read all data from buffer, convert it to string using Chr() and parse it. No big deal.
Upvotes: 0
Reputation: 6360
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.
Upvotes: 1
Reputation: 38130
Two options:
Option (1) is probably advisable
Upvotes: 6
Reputation: 425
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!
Upvotes: 3