The Location Acquisition API allows applications to access the location information of a mobile device regardless of the location technology used.
Typical use cases include:
Finding the location of a mobile device by GPS
Finding the location of a mobile device by network based positioning
Basic calculations using location information such as distances, bearing, and timestamp (see TPosition and Extended location information in the API reference guide.)
Important implementation considerations include:
Applications should close their RPositioner when they don't need positioning for an extended period of time. Also, when staying in background for more then a minute.
The system automatically selects an appropriate positioning method, based on the type of the class given as input for Open (RPositionServer &aPosServer) method. The system tries all available methods until it succeeds. Generally applications use this method. For special cases, applications can use Open (RPositionServer &aPosServer, TPositionModuleId aModuleId) to force system to use specified positioning method. In that case system does not fallback in case of failure
Note: The S60 3rd Edition, S60 3rd Edition Feature Pack 1, and S60 3rd Edition Feature Pack 2 SDKs do not have a Map API. You need to have a third party API to display the location information you receive on a map.
To find the location of a mobile device:
Use the methods of the Location Acquisition API to construct your application.
The RPositionServer and RPositioner classes are particularly relevant in getting the location of your device, which is typically stored in the TPositionInfo class.
For information on some detailed uses of the API, see the Location Acquisition API Usage section for:
list of the steps required for finding the location of a mobile device in a basic use case
how to obtain the current location estimate
how to obtain an extended location estimate, including information such as bearing, speed, and available satellites, which is not normally returned with the current location estimate
how to obtain your last known position information, using cached information if available. This means that this method does not retrieve the location information from the underlying positioning methods.
Make sure lbs.lib
is
accessible to your linker when compiling your application by including it
in your mmp
file
or by editing the project properties in your IDE, depending on your build
environment.
Make sure
you have the correct capabilities information
set for your application, depending on your application you need at least Location
.
For more information, see:
The purpose and general overview of the Location Acquisition API.
description and class structure of the API.
a general overview on how to create applications using the API.
for an example of how to use the Location Acquisition API,
see the LocationRefAppForS60 in the SDK at < SDK installation directory>\S60Ex\LocationRefAppForS60
.
The S60 platform also offers the following related services:
Information on how to include data, such as location information, in image files.
Information on how to store location information on your mobile device.
Information on how to use Bluetooth functions when creating connections between your mobile device and a Bluetooth enabled GPS receiver.