繁体   English   中英

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

[英]In my app I am not receiving speed in location object in Moto G 3rd generation Android 6.0 mobile

在我的应用程序中,我使用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);

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

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

提前致谢!

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

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

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM