If GPS fails will system automatically try geolocating?

Put problem concerning MapActivities, MapViews, Overlays and GPS in this forum.

If GPS fails will system automatically try geolocating?

Postby jermpatrick » Fri May 28, 2010 4:13 pm

If GPS fails to locate will the system automatically try geolocating? If not, how can I do that?
jermpatrick
Junior Developer
Junior Developer
 
Posts: 11
Joined: Thu May 13, 2010 8:16 pm

Top

Re: If GPS fails will system automatically try geolocating?

Postby Funkeeh » Fri May 28, 2010 6:54 pm

Yes i think so, if you use the ACCURACY_COARSE criteria

locationManager lm;

criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAccuracy(Criteria.ACCURACY_COARSE);

bestProvider = lm.getBestProvider(criteria, true);

ofc, remember to enable it in the Manifest.xml file

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
Funkeeh
Freshman
Freshman
 
Posts: 3
Joined: Tue May 25, 2010 9:57 pm
Location: Aalborg, Denmark

Top

Return to Map Problems

Who is online

Users browsing this forum: No registered users and 3 guests