GPS Programming Tips for Windows Mobile - Part 1
NETCF: Memory leak... now what??
Supporting Kiosk-Applications on Windows Mobile (Technically achievable vs. supported)
Wireless Programming on Windows Mobile: supported or not supported?
Establishing GPRS Connection on Windows CE and Windows Mobile: Sample Codes
Disable WebBrowser's Context-Menu in NETCF applications
MAPI on Windows Mobile 6: Programmatically retrieve mail BODY (sample code)
Microsoft released a HotFix for NETCF v3.5 on Windows Mobile 6.1.4 onwards, to address basic functionalities of WebBrowser control
The right approach to get a Contact’s last communication (IItem’s PIMPR_SMARTPROP)
Remote Desktop Mobile (RDP Client) disconnects after 10 minutes of inactivity
Support Boundaries for Windows Mobile Programming (Developing Drivers, for example... Or even WiFi Programming)
Miei post in italiano sul team-blog del Supporto Tecnico agli Sviluppatori
- Introducing GPS Intermediate Driver
Scenario: jogging in a park with a friend. You wouldn't like to carry on a Pocket PC with you, even if with integrated GPS Antenna (ok, you may prefer it...). So I chose a Smartphone in a pocket and the Bluetooth GPS Antenna in the other. Some runners prefer to have empty pockets or none at all, but I considered it a good deal.
Windows Mobile 5.0 introduced the GPS Intermediate Driver: "The GPS Intermediate Driver provides a very simple-to-use API for providing shared access to GPS data". By P/Invoking the stub gpsapi.dll, you can interact with the GPS Intermediate Driver below (gpsid.dll). Few APIs are needed:
#region PInvokes to gpsapi.dll
static extern IntPtr GPSOpenDevice(IntPtr hNewLocationData, IntPtr hDeviceStateChange, string szDeviceName, int dwFlags);
static extern int GPSCloseDevice(IntPtr hGPSDevice);
static extern int GPSGetPosition(IntPtr hGPSDevice, IntPtr pGPSPosition, int dwMaximumAge, int dwFlags);
static extern int GPSGetDeviceState(IntPtr pGPSDevice);
There's even 2 handy code samples available in the SDK (native and managed), that have everything you need to start with, together with relevant and helpful MSDN Documentation. An important detail to know about GPS Intermediate Driver is that on Smartphones you won't find the control applet, the one that would allow different applications to access the driver at the same time without interfering with each other, as reported in Setting up GPS on Windows Mobile 5 by Jason Fuller, thus having made the GPS Intermediate Driver unusable on Smartphones, in the sense that only one application can access the underlying GPS device at a time.
However, Windows Mobile 6 SDKs come with a pretty solution to this limitation: "GpsSettings.exe enables Smartphone users to set up the GPS intermediate driver. It works the same as the built-in GPS settings applet on Pocket PC." (C:\Program Files\Windows Mobile 6 SDK\Tools\GPS\Settings.exe). Windows Mobile 6 SDKs come also with a Fake GPS, so that developers can emulate receiving "data using the GPS APIs even if there is no GPS receiver on the device. The GPS data is read from NMEA .txt files that get deployed to \Program Files\FakeGPS\GPSFiles when FakeGPS.CAB is installed on the device" (C:\Program Files\Windows Mobile 6 SDK\Tools\GPS\FakeGPS.CAB).
A developer can work with GPS APIs if the GPS Antenna is integrated on the device and also if it's connected by other means, such as Bluetooth for example, as long as it can be considered a virtual COM port, which is set through the GPS settings applet.
However, if you want to play with NMEA sentences on your own, you can retrieve the streaming data from the antenna and interpret it, and raise events so that upper layers (typically the UI, for example). Before leveraging on the GPSID, I exactly wanted to play with NMEA sentences (once in my life!), so that I could later better appreciate the GPSID... more on the next post.
PingBack from http://msdnrss.thecoderblogs.com/2008/03/25/gps-programming-tips-for-windows-mobile-part-1/
- Useful samples on the web - Bluetooth Shared Source possible enhancements   As I wrote in a previous
- GPS Signal Quality - Error Reduction - Avoid problems with localizations - Data Layer: do NOT use XML