Updating cell tower information

You can find these managed wrappers on your development workstation, assuming you installed the Windows Mobile 6 SDK in the default folder, at the following path: C:\Program Files\Windows Mobile 6 SDK\Samples\Pocket PC\CS\GPS The path differs for the Windows Mobile 5.0 SDK.

When you consider the GPS sample inside the Windows Mobile 5.0 or Windows Mobile 6 SDK, you see a project that includes complete source code. To use these wrappers, you have to add a reference to this particular type library inside your own project.

This article addresses the technical details of adding location awareness to a Windows Mobile® application.

The paper covers related issues, such as the effect of location determination on battery life, and provides relevant code examples and a sample.

Therefore, if you no longer have to retrieve location information inside your application, make sure to call the Close method on the Gps object.

Omitting to call the Close method keeps the Gps radio fully powered, even if you no longer retrieve location information.

To retrieve a location synchronously, you only have to call one additional method after having called the Open method of the Gps object, as the following code example shows.

In this code example, a new instance of type Gps is created in the Main Form constructor and the Open method is called immediate to enable the GPS hardware.

updating cell tower information-84

The location is retrieved after using the synchronous method Get Position and is retrieved continuously by subscribing to the Location Changed event.

Visual Studio 2008 handles converting your project. Then you have to call the Open method on that object so that you can retrieve location information.

After the sample project is built, you see that it created both an executable and a type library. You can retrieve location information synchronously or asynchronously.

With GPSID, multiple applications can use the same physical GPS hardware, something that was not possible with devices earlier than Windows Mobile 5.0.

In those earlier Windows Mobile devices, only one application at a time could use GPS hardware.

Leave a Reply