In my app I am using FusedLocation.API for location updates, and I am using google play services-7.8.0. In onLocationChange() method, in location object i am not getting speed in Moto G(3rd Gen) Android 6.0. In all other mobiles I am able to receive speed. I tried with google play service versions 8.4.0 and 9.0.2 but no luck!
mLocationRequest = LocationRequest.create();
mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
mLocationRequest.setInterval(0);
mLocationRequest.setFastestInterval(0);
LocationServices.FusedLocationApi.requestLocationUpdates(mLocationClient, mLocationRequest, mLocationListener);
Can anyone please tell what could be the problem for this issue and how to overcome this issue ?
I am targeting for SDK 21 and also my compile SDK version is 21
Thanks in advance!
In marshmallow and higher location is considered a "Dangerous permission" Here's the article for google. https://developer.android.com/training/permissions/requesting.html
there's several third party libraries to help manage permissions
https://android-arsenal.com/tag/235
also make sure your permissions are declared in your manifest.xml
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