Blackberry GPS and BlackBerry Maps 매뉴얼 - 페이지 10
{카테고리_이름} Blackberry GPS and BlackBerry Maps에 대한 매뉴얼을 온라인으로 검색하거나 PDF를 다운로드하세요. Blackberry GPS and BlackBerry Maps 35 페이지. Version: 4.7.0
Development Guide
Get location information updates
You can associate only one LocationListener object with a particular provider for GPS location information. The
BlackBerry® device application typically listens for updates on a separate thread.
1.
Implement the LocationListener interface.
2.
To register your implementation, invoke LocationProvider.setLocationListener().
Change the criteria for obtaining location information
1.
Create a new Criteria object.
Criteria criteria2 = new Criteria();
2.
Invoke the setHorizontalAccuracy(), setVerticalAccuracy(), setCostAllowed(), and
setPreferredPowerConsumption() methods of the new Criteria object to specify the new criteria.
3.
Invoke LocationProvider.reset().
LocationProvider.reset();
4.
Specify the LocationListener to null.
provider.setLocationListener(null, -1, -1, -1);
5.
Invoke LocationProvider.getInstance() using the new Criteria object as a parameter to create a new
instance of a LocationProvider.
provider = LocationProvider.getInstance(criteria2);
6.
Specify the LocationListener.
provider.setLocationListener(LocationListener listener, int interval, int
timeout, int maxAge);
8
Getting GPS location information