Share via


Mobile GPS

Windows Mobile SupportedWindows Embedded CE Not Supported

8/28/2008

This code sample is named MobileGPS. The solution (MobileGPS.sln) is made up of three interdependent projects.

Projects Description

MobileGPSUI

This project implements the Windows Mobile powered device UI. Minor changes have been made to this project to use MobileGPSDemo. This project was generated using the Visual Studio Wizard.

MobileGPSLib

This lib file implements the core logic required to communicate with the GPS intermediate driver. In addition, it provides an abstraction to ease the process of asynchronously handling the GPS Intermediate events.

MobileGPSDemo

This project uses MobileGPSLib to communicate with the GPS Intermediate driver.

Feature Area

GPS Intermediate Driver Reference

Shell, GWES, and User Interface

Relevant APIs

GPS_DEVICE

GPS_POSITION

GPSCloseDevice

GPSGetDeviceState

GPSGetPosition

GPSOpenDevice

To run the code sample

  1. Navigate to the solution file (*.sln), and double-click it. By default, the solution file is copied to the following folder:C:\Program Files\Windows Mobile 6 SDK\Samples\Common\CPP\Win32\gps

    Microsoft Visual Studio 2005 launches and loads the solution.

  2. Ensure that the Intermediate Driver is set to emulate the GPS hardware.

  3. Build the solution (Ctrl+Shift+B).

  4. Deploy the solution (F5).

Development Environments

SDK: Windows Mobile 6 Professional SDK and Windows Mobile 6 Standard SDK

Development Environment: Visual Studio 2005.

ActiveSync: Version 4.5.

Demonstrates

MobileGPS demonstrates how to use native GPS Intermediate Driver Reference to asynchronously retrieve the location data and the GPS Intermediate Driver state.

Comments

The MobileGPSUI project has a linker input dependency on the gpsapi.lib library file.

It is left as an exercise for you to write the implementations for the two GPSSink "Set" functions, SetGPSPosition(GPS_POSITION gps_Position) and SetGPSDeviceInfo(GPS_DEVICE gps_Device).

Assumptions

Either the retail Windows Mobile powered device is GPS enabled, or the device emulator has been setup to simulate the GPS hardware.

See Also

Reference

GPS Application

Concepts

Code Samples for Windows Mobile

Other Resources

GPS Intermediate Driver Reference
GPS Intermediate Driver