Location API

Purpose

Computers today are more mobile than ever. From small laptops to Tablet PCs, many computers can go wherever the user wants to go. Programs that take advantage of the computer's mobility can add significant value to people's lives. For example, a program that can find nearby restaurants and provide driving directions would seem to be a natural fit for a portable computer. But while the technology to determine the user's current location is common and affordable, building solutions on this technology can be a daunting task.

To create a location-aware program, you might need to overcome a variety of issues, including:

  • Global positioning system (GPS) devices that use virtual COM ports, which provide access for only one program at a time.
  • Understanding and programming for protocols, such as the National Marine Electronics Association (NMEA) specification, as well as proprietary vendor extensions.
  • Being confined to programming for known, vertical hardware solutions.
  • Implementing logic to handle transitions between various location providers, such as GPS receivers, connected networks, cellular telephone networks, the Internet, and user settings.

This documentation describes the Windows Location application programming interface (API). The Location API helps to simplify location-aware programming by providing a standard way to retrieve data about user location and standardizing formats for location data reports. The Location API automatically handles transitions between location data providers and always chooses the most accurate provider for the current situation.

Note  Because information about a person's location can be sensitive data, Windows helps protect user privacy. For information about privacy protection, see Privacy and Security in the Sensor and Location Platform.

Developer Audience

The Location API provides its functionality through a set of COM interfaces. Location API functionality can be used by programmers who are familiar with using COM through the C++ programming language, or with using COM objects in scripting languages, such as Microsoft JScript.

In This Section

Send comments about this topic to Microsoft

Build date: 11/17/2009

Tags :


Community Content

DSC_KE_MSFT
Client applications using the Location API may fail to reteive data on the initial request

Summary

=============================

It's possible for a client application that synchronously to fail to get data on it's first request after a sensor goes into a ready state. To recover the client application would need to make an additional synchronous request or listen to API events.

More Information

=============================

[environment]

Arch: [x86fre]

Number of Pseudo Sensors: [0]

Sensor Device: Skyhook partner sensor

DLP Data: [no]

[automation repro]

n/a

[steps]

1. Install driver.

2. Enable it for all users.

3. Launch a tool like DebugView to listen for system debug messages.

4. Launch Places Gadget

Note that from debug output after the device signaled a ready state the first time Places attempts to get data the request fails:

[1688] LocationManager.UpdateReportLatLongStatus: Enter.

[1688] LocationHandler.LatLongLocationStatus: Enter.

[1688] LocationHandler.LatLongLocationStatus: Status: 4.

[1688] LocationHandler.LatLongLocationStatus: Exit.

[1688] LocationManager.UpdateReportLatLongStatus: Status has been updated to running. Requesting updated lat/long.

[1688] LocationManager.ReportLatLong: Enter.

[1688] LocationManager.ReportLatLong: Lat and Long are currently null. Location Handler was not called.

[1688] LocationManager.ReportLatLong: Exit.

Note: The "Lat and Long are currently null" message means that we tried to access a Location Report (or the members of the Lat Long report) and we got an exception – so our member variables were set to NULL. This exception behavior is known behavior for the Dispatch Interface.

 

The high level expecation is that the request for data should be serviced without an error. The current design doesn't support this.

Tags :

Page view tracker