[英]In my app I am not receiving speed in location object in Moto G 3rd generation Android 6.0 mobile
In my app I am using FusedLocation.API for location updates, and I am using google play services-7.8.0. 在我的应用程序中,我使用FusedLocation.API进行位置更新,我正在使用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.
在onLocationChange()方法中,在位置对象中我没有在Moto G(第3代)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!
我尝试使用谷歌播放服务版本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);
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 我的目标是SDK 21,我的编译SDK版本是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
https://developer.android.com/training/permissions/requesting.html
there's several third party libraries to help manage permissions 有几个第三方库来帮助管理权限
https://android-arsenal.com/tag/235 https://android-arsenal.com/tag/235
also make sure your permissions are declared in your manifest.xml 还要确保在manifest.xml中声明了您的权限
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.