In my application, I do not get speed in the location object in the Moto G 3rd generation Android 6.0 mobile

In my application, I use FusedLocation.API ​​for location updates, and I use google play services-7.8.0. In the onLocationChange () method in the location object, I don't get speed in Moto G (3rd Gen) of Android 6.0. In all other mobile phones, I can get speed. I tried with versions 8.4.0 and 9.0.2 on Google Play, 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 tell what could be the problem for this problem and how to solve this problem?

I targeted SDK 21 as well as my compilation SDK version - 21

Thanks in advance!

+5
source share
1 answer

A marshmallow and a higher place is considered a "dangerous permit." Here is an article for google. https://developer.android.com/training/permissions/requesting.html

there are several third-party libraries for managing permissions

https://android-arsenal.com/tag/235

also make sure your permissions are declared in your manifest.xml

+1
source

All Articles