Cell mode GPS "Timeout"
Please Login to Remove!
Hello,
I'm developing a program to OS 5.0 and to get GPS latitude and longitude I do.
BlackBerryLocationProvider bbProvider = null;
BlackBerryLocation bbLocation = null;
if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_CELLS ITE)) {
_myCriteria = new BlackBerryCriteria(GPSInfo.GPS_MODE_CELLSITE);
if (GPSInfo.isGPSModeAvailable(GPSInfo.GPS_MODE_AUTON OMOUS))
{
_myCriteria.setFailoverMode(GPSInfo.GPS_MODE_AUTON OMOUS, 1, 30);
_myCriteria.setSubsequentMode(GPSInfo.GPS_MODE_AUT ONOMOUS);
}
}
try {
bbProvider = (BlackBerryLocationProvider)LocationProvider.getIn stance(_myCriteria);
} catch (LocationException e) {
System.out.println(e.getMessage());
_latitude=0;
_longitude=0;
_finished=true;
return;
}
if (bbProvider!=null)
{
try {
bbLocation = (BlackBerryLocation) bbProvider.getLocation(-1);
} catch (LocationException e) {
System.out.println(e.getMessage());
_latitude=0;
_longitude=0;
_finished=true;
return;
} catch (InterruptedException e) {
System.out.println(e.getMessage());
_latitude=0;
_longitude=0;
_finished=true;
return;
}
}
else
{
_latitude=0;
_longitude=0;
_finished=true;
return;
}
if (bbLocation!=null && bbLocation.isValid())
{
_latitude=bbLocation.getQualifiedCoordinates().get Latitude();
_longitude=bbLocation.getQualifiedCoordinates().ge tLongitude();
_finished=true;
return;
}
else
{
_latitude=0;
_longitude=0;
_finished=true;
return;
}
But only gets latitude and longitude some times, in an specific place I move 2 meters and it doesn't get it. And the coverage is full? What is wrong? Can be my device BB curve 9520. If It doesn't get latitude it says "Time out ".
Best regards
|