Task
Steps
Specify that no level
of accuracy for
longitudinal and
latitudinal data is
required,
a.
Invoke
criteria.setHorizontalAccuracy(NO_REQUIREMENT)
.
b.
Invoke
criteria.setVerticalAccuracy(NO_REQUIREMENT).
3.
Invoke
criteria.setCostAllowed(true)
to specify that this mode can incur cost.
4.
Invoke
criteria.setPreferredPowerConsumption(POWER_USAGE_HIGH)
to specify power
consumption is high.
5.
Invoke
LocationProvider.getInstance()
, storing the returned object in a
LocationProvider
object.
LocationProvider provider = LocationProvider.getInstance(criteria);
Get location information from the GPS receiver on a BlackBerry device
1.
Create an instance of a
Criteria
object.
Criteria criteria = new Criteria();
2.
Complete one of the following tasks to get location information using the GPS receiver on a BlackBerry device :
Task
Steps
Specify a level of accuracy,
with no cost and no power
consumption.
a.
Invoke
criteria.setHorizontalAccuracy(int accuracy)
using
an integer value that represents the accuracy, in meters.
b.
Invoke
criteria.setVerticalAccuracy(int accuracy)
using an
integer value that represents the accuracy, in meters.
c.
Invoke
criteria.setCostAllowed(false)
.
Specify a level of accuracy,
with cost and variable
power consumption.
a.
Invoke
criteria.setHorizontalAccuracy(int accuracy)
using
an integer value that represents the accuracy, in meters.
b.
Invoke
criteria.setVerticalAccuracy(int accuracy)
using an
integer value that represents the accuracy, in meters.
c.
Invoke
criteria.setCostAllowed(true)
.
d.
Invoke
criteria.setPreferredPowerConsumption(int level)
using
one of
POWER_USAGE_LOW
,
POWER_USAGE_MEDIUM
,or
NO_REQUIREMENT
as the parameter.
Development Guide
Specifying the source of GPS location information
5