Access GPS features on WinMobile phones

Let's say you have a phone running Windows Mobile 6.0, which also has a GPS receiver. Does WinMobile SDK support GPS access?

If not, then what are the options (API) for programming using GPS, I am writing applications that will use the capabilities of GPS. I am mostly interested in Windows Mobile 6.x, but please also include general answers.

I will definitely vote for the most helpful answers.

Thanks in advance.

+4
source share
6 answers

Two options:

  • There is an intermediate GPS driver in which article articles for .Net on MSDN
  • You can connect to the serial port (of course, customizable in the user interface) and independently analyze the NMEA strings.

Option (1) is probably recommended.

+6
source

Chris Craft had a lot of source code for this kind of thing in his 30 day .NET Windows Mobile Applications series.

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

Unfortunately, this blog series seems to have died, but, fortunately, the code is stored on Codeplex:

30 days Windows Mobile Applications

Both the C port and some discussions around some source posts can be found on / dev / mobile

There are also comments on using an intermediate GPS driver on Raffaele Limosani Blog


Edit to add:

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

GPS.NET 3.0

+5
source

If you plan to develop in the .NET Compact Framework, the examples for Windows Mobile developers have a fairly extensive GPS example. It mainly uses a wrapper around gpsapi.dll, but it shows work. I installed the WM6 kit in C: \ Program Files \ Windows Mobile 6 SDK, and the GPS sample is then located in the C: \ Program Files \ Windows Mobile 6 SDK \ Samples \ PocketPC \ CS \ GPS

Good luck

+3
source

Try a look at some of the solutions on CodeProject.com . There are many good articles on Windows Mobile and GPS.

+2
source

And to test the code that uses the intermediate driver (see other answers), don't forget the FakeGPS utility from the SDK, which you can use to transfer the NMEA stream stored in the file through this intermediate driver so that you can easily test the GPS software on data from this location without actually receiving a GPS signal and starting movement.

+1
source

From my point of view, it is much easier to read the serial port (in my case COM5, the transmission speed is 4800) and analyze the received data. (how to parse a string can be found via Google and the phrase: gps NMEA sentences)

It is impossible for me to understand the example at:

C:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS 

It is all so complicated and unstable. I would expect a much more convenient and useful interface, for example:

 myGps = new GPS() myGPS.getPosition 

But this is probably not possible :(

And how to do it through RS232? (I work in VB.NET)

In the GUI (or programmatic), create a System.IO.Ports.SerialPort object and use its DataReceived event. Whenever data comes from GPS, this event occurs, and in it you can process it.

The data is in the format of a loooong string, partitioned into $ GPGGA, $ GPGSA, etc. Important is $ GPGGA. Each specific information is separated by a comma. Then you simply parse this line - in VB.net, using: myArray = myData.Split ("," c).

http://aprs.gids.nl/nmea/

PS: "," c means that the comma is a Char character, not a String (VB.NET)

As you can see, there is no need to write more than a few lines of code. The MS example is useless and not intended for beginners.

PS2: Please note that you are not sending any commands to GPS. It automatically and periodically sends data to your program. You simply open the port, read all the data from the buffer, convert it to a string using Chr (), and parse it. Nothing wrong.

0
source

All Articles