How to check location availability using FusedLocationProviderApi and GoogleClient?

We can check for a location using the Location Manager isProviderEnabled method. I am trying to use the new api for a location, i.e. fusedLocationProviderApi, and trying to check if a location can be found. How to check it?

+4
source share
1 answer

As you mentioned in your question, you can check if the provider is enabled using the Location Manager isProviderEnabled method, as shown below.

LocationManager lm = (LocationManager) getActivity().getSystemService(Context.LOCATION_SERVICE);
lm.isProviderEnabled(LocationManager.GPS_PROVIDER);

FusedLocationApi GoogleApiClient LocationRequest, LocationListener, . onLocationChanged(Location location). , , onLocationChanged.

, ; , , , GoogleApiClient, , GooglePlayServices .., .

+1

Source: https://habr.com/ru/post/1589474/


All Articles