I am trying to get current location using GPS
,Cellular Network
or WiFi
.I am giving criteria to choose best provider. But It is always showing GPS
is best provider. It is ok when i am outside and GPS
signal is strong but it is not true when i am indoor or GPS
signal is poor.
The criteria are
Criteria criteria = new Criteria();
criteria.setAccuracy(Criteria.ACCURACY_FINE);
criteria.setAltitudeRequired(false);
criteria.setBearingRequired(false);
criteria.setCostAllowed(true);
criteria.setPowerRequirement(Criteria.POWER_LOW);
WifiManager wifi = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wifi.setWifiEnabled(true);
String provider = lm.getBestProvider(criteria, true);
What is the solution? Any help please.