在我的应用程序中,我没有在Moto G第3代Android 6.0移动版中获得位置对象的速度

Ren*_*adh 5 android motorola google-play-services

在我的应用程序中,我使用FusedLocation.API进行位置更新,我正在使用google play services-7.8.0.在onLocationChange()方法中,在位置对象中我没有在Moto G(第3代)Android 6.0中获得速度.在所有其他手机中,我能够获得速度.我尝试使用谷歌播放服务版本8.4.0和9.0.2,但没有运气!

mLocationRequest = LocationRequest.create();
        mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);
        mLocationRequest.setInterval(0);
        mLocationRequest.setFastestInterval(0);

LocationServices.FusedLocationApi.requestLocationUpdates(mLocationClient, mLocationRequest, mLocationListener);
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉这个问题可能是什么问题以及如何克服这个问题?

我的目标是SDK 21,我的编译SDK版本是21

提前致谢!

Dan*_*ont 1

在棉花糖和更高的位置被认为是“危险许可”这是谷歌的文章。https://developer.android.com/training/permissions/requesting.html

有几个第三方库可以帮助管理权限

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

还要确保您的权限在您的manifest.xml中声明