Google recommends now using Google Play Services
to manage user location.
But how can we, using this API, check wether GPS is turned on in device or if we still have gps connection?
In com.google.android.gms.location.LocationListener
we have only one method abstract void onLocationChanged(Location location)
which is called when the location has changed, but we don't know there anything about GPS status.
How to use Google Play Services
like "old" LocationManager
and LocationListener
?
But how can we, using this API, check wether GPS is turned on in device or if we still have gps connection?
You can't, AFAICT. I suppose the argument is that since LocationClient
is blending data from several sources, there is no API to determine if any specific source is or is not being used.
You will need to use LocationManager
if you want to determine whether GPS is enabled or not.
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