I'm looking at the example of radar city example :
http://code.google.com/p/andengineexamples/source/browse/src/org/anddev/andengine/examples/app/cityradar/CityRadarActivity.java?r=dea4a6fe72f983821ddbc287cfb90a8562f4b433
and i have implemented the ILocationListener and have enabled the location sensor and have also enabled the location sensor through the onResume method:
@Override
protected synchronized void onResume()
{
super.onResume();
System.gc();
final LocationSensorOptions locationSensorOptions = new LocationSensorOptions();
locationSensorOptions.setAccuracy(Criteria.ACCURACY_COARSE);
locationSensorOptions.setMinimumTriggerTime(0);
locationSensorOptions.setMinimumTriggerDistance(0);
this.enableLocationSensor(this, locationSensorOptions);
}
and then tried to get location on the location changed through the implemented method
@Override
public void onLocationChanged(Location plocation) {
this.mUserLocation = plocation;
curlng = mUserLocation.getLongitude();
curlat = mUserLocation.getLatitude();
}
but i am only getting zeros and i am little bit confused on whether or not use the location sensor built in andengine or use the android native location sensor?
It uses the Android Location Sensor.
There are few things that you should check:
ACCESS_FINE_LOCATION and ACCESS_COARSE_LOCATION permissions in your AndroidManifest.xml? It won't be possible to give an exact answer unless you post your Logcat output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With