简体   繁体   中英

Getting Location Services Running Unity/Tango

I am building a simple app in Unity/Tango platform.

I am trying to get the location. I followed the steps in this https://docs.unity3d.com/ScriptReference/LocationService.Start.html

So after 20 seconds wait it 'Timed out' and the Status is always 'initializing'.
The Input.location.lastData.latitude and Input.location.lastData.longitude is always zero.

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" />

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”).

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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