i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

Last post 02-19-2008 14:55 by ieatskunk. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 02-19-2008 8:47

    i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

    Hello,

     the title is stupid but will help on Google searchers.

     can someone provide us with a sample written in VB to work on a smartphone and use the GPS coordinates. initialiazation.. stuff like that.

     

     

    Thanks,

    ionut


    PS: I googled for 3 days and didn't found any:( 

    Filed under:
  • 02-19-2008 11:27 In reply to

    Re: i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

     What you are asking for is non trivial.  The book Compact Framework Core Reference has a great example of connecting to the device's COM port to read data:  http://www.microsoft.com/mspress/books/5960.aspx  Its an old book so you can probably get it used for really cheap.  Once you are connected to the COM port that the GPS device is talking to you just need to parse the GPS data.  This has a good description of the NMEA sentences produced by GPS devices: http://www.gpsinformation.org/dale/nmea.htm

     If possible you should consider upgrading to Visual Studio 2005 or 2008 and targeting Compact Framework 2.0 because it added a managed Serial Port class which would make things a lot easier in terms of reading data from the COM port.
     

    N I C K
  • 02-19-2008 11:35 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 1,868

    Re: i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

    The open source OpenNETCF.Serial library will probably be helpful.  It's code-compatible with CF 1.0 and has NMEA parsing routines built-in.

    Filed under: ,
  • 02-19-2008 13:58 In reply to

    Re: i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

     nick,

     i am working over ppcanywhere to a computer that connects with a remote view app that connects to a blackjackII... please don't make my life suck:) i have to press F1 and F2... every action i do takes 2 seconds to see it on screen...

    do you own a sample code for smartphone made in VB to use a GPS?


     

    thank you,

    ionut 

  • 02-19-2008 14:54 In reply to

    Re: i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

    i started to convert code from C to vb and it's very hard for me since i don't have any C expereience....

  • 02-19-2008 14:55 In reply to

    Re: i need a Visual studio 2003 GPS sample/tutorial for VB to work on a smartphone

    You probably think we're holding out on you, but we aren't. 

     Reading GPS data in your program from a GPS device requires the following steps (function definitions are on MSDN, you need to P/Invoke the native functions):

    <1>Connect to the serial port (ie COM port) using native function CreateFile

    <2>Configure the port for timeouts and COM junk using more native functions (GetCommState, SetCommState, GetCommTimeouts, SetCommTimeouts, etc).

    <3>Use native function ReadFile to fill a buffer with data from the serial port (ie from the GPS device).

    <4>Take that binary data and convert it into ASCII characters using the Bitconverter Class.

    <5>The characters make up the NMEA data, parse the GPS info you want out of it.

    <6>Close the connection to the port using native function CloseHandle.  Make sure to do this since you are using resources that are not managed by the compact framework.

    Here's an MSDN article that tells how to connect to the serial port using VB.net.  As you can see from the article it's non trivial. Good luck.  Consider using the smart device framework from opennet.  Like ctacke said, it takes care of most of this for you. 

    N I C K
Page 1 of 1 (6 items)