GPS (Location-based) API

F

fhunter

Is there a API that I can use to obtain GPS information
(longitude, latitude) (if there is a device attached to
the PocketPC or Smartphone ofcourse!)

Thanks
 
G

Graham McKechnie

fhunter

I'm not aware of any API.

You need to use or build a CF Comm class to open and read from a serial
port. Once you have that done its just a matter of parsing the NMEA strings
which the GPS receives - contains the lat/lon plus much more.

Graham
 
V

Vance Green

Thes guys have some interesting stuff:

http://www.pocketterra.com/default.htm

But it's not an API, and it's expensive.

Graham's "roll your own" may be the way to go.
Parsing the NMEA isn't all that hard-there's plenty of good
descriptions of the output strings on the Internet.
 
K

Kris Luyten

Is there a API that I can use to obtain GPS information
(longitude, latitude) (if there is a device attached to
the PocketPC or Smartphone ofcourse!)


We are using the Haicom GPS module for the Pocket PC, and did not find an
appropriate API that wraps the code for serial communciation with the GPS
device yet.


Probably, you just have to programm it using P/Invoke. See my posting
about the WaitCommEvent problem, it shows some code we use to access the
GPS device. Also, Noah Coad's tutorial about serial COM
(http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=320)
and the msdn article about serial comunication
(http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default.aspx) are very helpful.

I found the code of pocketwarrior (http://www.pocketwarrior.org/) also helpful because it contians (C++)
code for accessing a GPS device.


Regards,
Kris
 
A

Alberto Silva

Hi,
Take a look to the editorial of the freely availabale online issue of MSDN
Magazine... There's a definitive link to a .net cf sample of the GPSboy
project. I don't remeber if it is the current or the last issue, but they
are both online.

Alberto Silva
 
D

Dick Grier

Hi,

No, you have to do the decoding yourself. Most GPS devices use the serial
port. You can download my CFSerialIO assembly (DLL), then decode the
NMEA-0183 sentences in the OnComm event handler. I have decoding examples
in my book (see below), and there is example code available online (search
for GPSBoy).

Dick
--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
 
F

fhunter

Thanks everyone for hte help. Although disapointed this
is very useful information.

With respect to Location-Based. As a developer it will be
necesary in the near future to be able to obtain the
location information of a cell phone user, regardless of
where the information is comming from. GSP, service
provider, local tower information or most likely a mix of
all of the above. A Location-base API will need to be
implemented for the Compact framework so that each device
can have the most appropiate way to get this location
info.

I woudl assume Microsoft is working on soemthing like
this, are they not??????
 
G

Graham McKechnie

Luk,

It probably should be like this.

[DllImport ("coredll.dll")]
private static extern int SetCommState(int hFile, ref DCB lpDCB);
Result = SetCommState(Handle, ref lpDCB);

Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top