A-GPS on BlackBerry OS 5
I'm developing an application that is targeting Blackberry OS 5.0 mobile devices and I'm testing on a BlackBerry Curve 9300 on T-Mobile UK (GSM?). I'm having absolutely no luck getting location updates with the A-GPS using GPS_MODE_ASSIST
(or even a rough fix via CELLSITE) even though the device reports it as supported via GPSInfo.isGPSModeAvailable()
. It is possible to get a location fix using AUTONOMOUS however the time to first fix is often unusably high. I wonder if anyone could offer any suggestions for getting the A-GPS to work or how to improve the time to first fix?
BlackBerryCriteria myCriteria = new BlackBerryCriteria(GPSInfo.GPS_MODE_ASSIST);
BlackBerryLocationProvider locationProvider = (BlackBerryLocationProvider) LocationProvider.getInstance(myCriteria);
locationProvider.setLocationListener(new LocationListener() {
public void locationUpdated(LocationProvider provider, Location location) {
if (l开发者_运维百科ocation.isValid()) {
// display some interesting values on the screen.
double longitude = location.getQualifiedCoordinates().getLongitude();
double latitude = location.getQualifiedCoordinates().getLatitude();
int accuracy = (int) location.getQualifiedCoordinates().getHorizontalAccuracy();
GPSDemo.this.appendScreenText("\nlat, long: " + latitude + ", " + longitude + " accuracy: " + accuracy + "m");
}
}
public void providerStateChanged(LocationProvider provider, int newState) {
if (newState == LocationProvider.TEMPORARILY_UNAVAILABLE) {
provider.reset();
}
screen.setState(newState);
}
}, 1, -1, -1);
Assisted GPS and CellSite fixes require support from the wireless network. Prior to OS 6.0 that support has to come from your wireless carrier. On 6.0 and latter RIM provides some support.
精彩评论