Sorry for the delay in my answer.
The lib needs GPS or NETWORK (Network is Wifi or GSM). If none is available you'll get 'No provider Found'.
I'll check them by doing this:
Code:
lm = (LocationManager) ba.context.getSystemService("location");
//exceptions will be thrown if provider is not permitted.
try{
gps_enabled=lm.isProviderEnabled(LocationManager.GPS_PROVIDER);
}catch(Exception ex){
//System.out.println("error gps!");
}
try{
network_enabled=lm.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
}catch(Exception ex){
//System.out.println("error netwerk!");
}
//don't start listeners if no provider is enabled
if(!gps_enabled && !network_enabled)
{
lastError="No Provider Found";
return false;
}
to get the location, i'll use:
Code:
if(gps_enabled)
gps_loc=lm.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if(network_enabled)
net_loc=lm.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
According to some info I found on the net, android does keep track of your last location and if no way is found to update your location, it returns this last location.
This last location is reset by a reboot.
I do think google is used in some way by calling this getLastKnownLocation() function so this may explain why Archos has problem with it.
Remember you have to see this as a last way to get your location. First always try the GPS lib to get an accurate location. I've got reasonable succes using it, but sometimes it is way off (like 500m).
I'm guessing this is the way Google maps finds your location if no gps is found. I'm getting similar results anyway.