locked
Using GPS at C# RRS feed

  • Question

  • Hello,
    I want to develop a program which uses GPS info. My questions are:
    1) How can I simulate GPS position at device emulator.
    2) I have looked at the GPS sample code at Program Files\Windows Mobile 6 SDK\... but I think I will need some more information. Is there a documentation of GPS functions like javadoc? Or what is the fastest way for me (I am very new at C# and windows mobile programming) to get GPS info?
    Thanks.
    Tuesday, April 28, 2009 12:17 PM

Answers

  • If you have Windows Mobile 6 SDK installed in your machine... go to 

    D:\Program Files\Windows Mobile 6.0 SDK\Tools\GPS ... Go through the FakeGPS read me.txt...

    A sample program is also given at D:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS" folder.
    Regards, Navin Narayan
    • Marked as answer by warrentang Monday, May 4, 2009 2:11 AM
    Tuesday, April 28, 2009 1:08 PM

All replies

  • Hello again and thanks for the quick reply,
    Can you please tell me how can I simulate the GPS on the emulator?
    Thank you.
    Tuesday, April 28, 2009 12:56 PM
  • If you have Windows Mobile 6 SDK installed in your machine... go to 

    D:\Program Files\Windows Mobile 6.0 SDK\Tools\GPS ... Go through the FakeGPS read me.txt...

    A sample program is also given at D:\Program Files\Windows Mobile 6 SDK\Samples\PocketPC\CS\GPS" folder.
    Regards, Navin Narayan
    • Marked as answer by warrentang Monday, May 4, 2009 2:11 AM
    Tuesday, April 28, 2009 1:08 PM
  • Hi,

    As you already mentioned, that you have looked at Program Files\Windows Mobile 6 SDK\...  I dint provide that information.

    Any way please open the same code( from the path you mentioned) and follow these links

    http://msdn.microsoft.com/en-us/library/bb158722.aspx

    http://www.devx.com/wireless/Article/34696/0/page/4


    Please let me know if you have any queries regarding this.

    Regards,
    Malleswar
    Tuesday, April 28, 2009 1:23 PM
  • Hello again,
    When I try to run the sample gps application on device, i get a NullPointerException at
            protected void gps_LocationChanged(object sender, LocationChangedEventArgs args)
            {
                position = args.Position;
    
                // call the UpdateData method via the updateDataHandler so that we
                // update the UI on the UI thread
                Invoke(updateDataHandler);
    
            }
    Invoke(updateDataHandler) function. Am I doing smt wrong or the sample application not working or how can I fix this error? I have tested the sample GPS application on Samsung i900 (omnia).
    Thanks.
    Tuesday, April 28, 2009 2:38 PM
  • Hi,

    Its working fine on my emulator with the same code. I did not try on device.

    Any way try to replace Invoke(updateDataHandler)  with 

    this
    .Invoke(updateDataHandler);


    If still does not work, Please let me know, So that I can try on Omnia and let you know.

    Regards,
    Malleswa

    Tuesday, April 28, 2009 2:55 PM
  • Hello,
    After replacing Involke with this.Invoke(updateDataHandler); doesn't fix the NullReferenceException. Can I do smt wrong? After opening sample project i just runned it on Windows Mobile profesional 6 device.
    Is there any simple sample code that is working?
    Thanks.
    Tuesday, April 28, 2009 3:02 PM
  • Can you please try the same on emulator and let me know?


    Regards,
    Malleswar
    Tuesday, April 28, 2009 3:21 PM
  • Hello,
    At emulator I can't simulate the GPS.
    After I run code at emulator. I click GPS-> Start GPS, it displays On StrartingUp and nothing else happens.
    Wednesday, April 29, 2009 7:43 AM
  • I think you did not follow the links which I gave for fake GPS on emulator.

    Regards,
    Malleswar
    Wednesday, April 29, 2009 7:50 AM
  • Take a look at http://serialcs.sourceforge.net, it reads the GPS positions directly over the serial interface, rather than using Microsoft GPSD, which does not work on every device. The program can show the current positions on maps (scans, screenshots or downloaded from http://www.openstreetmap.org). It can also read the NMEA stream through IP (TCP and UDP), maybe an idea to make a real GPS emulator obsolete. Just record some NMEA stream from a real GPS device and using the program serial.exe included in the project and send it through IP to the emulator using for example netcat.
    Besides the source code, nant scripts etc. you'll also find some links to existing documentation on SiRF's NMEA sequences (http://gpsd.berlios.de/vendor-docs/sirf/) in there.
    If you'd prefer something similar in C, take a look at the program cb available on http://stoyac.privat.t-online.de. Compiles with cegcc, MS EVC 4 and recent Visual Studios, makefiles and sources available.
    Daniel
    Monday, November 2, 2009 9:17 AM
  • Thursday, December 8, 2011 11:50 AM