Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Contributor
sleiva
Posts: 20
Registered: ‎11-19-2010
My Device: Not Specified

Problems BlackberryLocation.getAverageSatelliteSignalQuality () and BlackberryLocation.getSatelliteInfo ()

Hi all:

 

I use the following code in my application

 

 

public void locationUpdated(LocationProvider provider, Location location){
if (location.isValid()){			
	try {
		BlackBerryLocation bLoc = (BlackBerryLocation)location;
		Posicion pos = new Posicion( 
			new Float(bLoc.getQualifiedCoordinates().getLatitude()),
			new Float(bLoc.getQualifiedCoordinates().getLongitude()),
			new Float(bLoc.getQualifiedCoordinates().getAltitude()),
			(Float.isNaN(bLoc.getQualifiedCoordinates().getHorizontalAccuracy()))?new Float(-1):new Float(bLoc.getQualifiedCoordinates().getHorizontalAccuracy()),
			(Float.isNaN(bLoc.getQualifiedCoordinates().getVerticalAccuracy()))?new Float(-1):new Float(bLoc.getQualifiedCoordinates().getVerticalAccuracy()),				
			new Long(System.currentTimeMillis()),
			new Float(bLoc.getSpeed()),
			new Integer(DeviceInfo.getBatteryLevel()),
			new Integer(bLoc.getSatelliteCount()),
			new Integer((bLoc.getSatelliteInfo()!=null)?Posicion.numeroSatelitesConectado(bLoc.getSatelliteInfo()):/*Posicion.getNumSatellites(location)*/-1),
			new Integer(bLoc.getAverageSatelliteSignalQuality()),
			new Integer(0),
			new Integer(HandlerPosicion.estadoLocationProvider()));
					
			bLoc = null;
					
	} catch (Exception e) {
	}
}else{
	BlackBerryLocation bLoc = (BlackBerryLocation)location;
	errorUltimaPosicion = bLoc.getError();
}
}

The problem is that the method bLoc.getAverageSatelliteSignalQuality () always returns null and the method bLoc.getSatelliteInfo () always returns 0. While:

bLoc.getQualifiedCoordinates (),
bLoc.getSpeed (),
etc.

Is obtained without problems.

My criteria is configured as follows

 

myCriteria = new BlackBerryCriteria(GPSInfo.GPS_MODE_AUTONOMOUS);
myCriteria.setSpeedAndCourseRequired(true);
myCriteria.setAltitudeRequired(true);
myCriteria.setSatelliteInfoRequired(true, false);

And the LocationListener is instantiated inside a Thread

I tested with Blackberry OS 5 and Blackberry OS 6 and have had these problems

Could you help me?

 

Please use plain text.