简体   繁体   English

使定位服务运行Unity / Tango

[英]Getting Location Services Running Unity/Tango

I am building a simple app in Unity/Tango platform. 我正在Unity / Tango平台上构建一个简单的应用程序。

I am trying to get the location. 我正在尝试获取位置。 I followed the steps in this https://docs.unity3d.com/ScriptReference/LocationService.Start.html 我按照此https://docs.unity3d.com/ScriptReference/LocationService.Start.html中的步骤进行操作

So after 20 seconds wait it 'Timed out' and the Status is always 'initializing'. 因此,在20秒钟后等待它“超时”,并且状态始终为“正在初始化”。
The Input.location.lastData.latitude and Input.location.lastData.longitude is always zero. Input.location.lastData.latitude和Input.location.lastData.longitude始终为零。

In addition I have set this in the AndroidManifest.xml file: <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:name="android.hardware.location.gps" android:required="true" /> <uses-feature android:name="android.hardware.location" android:required="true" /> 此外,我还在AndroidManifest.xml文件中进行了设置: <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-feature android:name="android.hardware.location.gps" android:required="true" /> <uses-feature android:name="android.hardware.location" android:required="true" />

Any help would be appreciated. 任何帮助,将不胜感激。

-Thanks -谢谢

Found the answer: On Android devices, LocationService doesn't work without setting “high accuracy” location mode in the system settings (“Settings” -> “Location” -> “Mode”). 找到了答案:在Android设备上,如果没有在系统设置(“设置”->“位置”->“模式”)中设置“高精度”位置模式,LocationService将无法工作。

Reference: https://issuetracker.unity3d.com/issues/android-locationservice-doesnt-work-without-high-accuracy-mode 参考: https : //issuetracker.unity3d.com/issues/android-locationservice-doesnt-work-without-high-accuracy-mode

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

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