Blackberry GPS and BlackBerry Maps Manuale - Pagina 7

Sfoglia online o scarica il pdf Manuale per Software Blackberry GPS and BlackBerry Maps. Blackberry GPS and BlackBerry Maps 35. Version: 4.7.0

Development Guide
Task
Specify that no level
of accuracy for
longitudinal and
latitudinal data is
required,
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
Specify a level of accuracy,
with no cost and no power
consumption.
Specify a level of accuracy,
with cost and variable
power consumption.
Steps
a.
Invoke criteria.setHorizontalAccuracy(NO_REQUIREMENT).
b.
Invoke criteria.setVerticalAccuracy(NO_REQUIREMENT).
Steps
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).
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.
Specifying the source of GPS location information
5