简体   繁体   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

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.

相关问题 如果我在Android App中使用3rd party库,应该将许可证放在哪里? - Where should I put License, If I am using 3rd party library in My Android App Android App中的旋转矢量传感器无法在我的Moto G上运行 - Rotation Vector Sensor in Android App not Working on my Moto G 签名的 apk 未在我的 MOTO G 手机上运行 - SIgned apk not running on my MOTO G mobile 如何在我的ant构建中覆盖libs /作为Android第三方库的位置? - How can I override libs/ as the location of my Android 3rd party libraries in my ant build? MediaPlayer.pause()在Moto G Turbo Edition Android 6.0中不起作用 - MediaPlayer.pause() not working in Moto G Turbo Edition Android 6.0 Android:共享数据并从第三方应用程序接收文本。 为什么我的应用程序没有收到新文本? - Android: Sharing Data and Receiving text from 3rd party app. Why doesn't my app receive new text? 将第 3 方 Android JAR 集成到 Titanium 移动应用程序中? - Integrating 3rd party Android JAR into Titanium Mobile app? 从第三方Android应用程序更新Google定位的位置 - Update Google Latitude location from 3rd party android app 在Android中我的应用程序中打开和关闭第3方应用程序 - Open and close 3rd party app within my app in android 如何允许第 3 方应用程序在 Android 上为我的应用程序设置主题? - How can I allow 3rd party apps to theme my app on Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM