我想实现一个通过手机方向计算位置列表(经度和纬度)的功能。结果可以是一个矩形形状,将角点作为位置。
首先,我如何找到设备当前方向,即后置摄像头指向哪个方向?
那么如何通过这个方向获取位置信息列表呢?
谢谢
最佳答案
来自documentation根据 Google Maps Android API,Android 设备可用的位置数据包括使用多种技术组合精确定位的设备当前位置 - 移动方向和方法,以及设备是否已移动穿过预定义的地理边界或地理围栏。
This is the 3 options that you can do with your app.
Using My Location layer that provides a simple way to display the device's location on the map. It does not provide data.
Using Google Play services Location API is recommended for all programmatic requests for location data.
And using the LocationSource interface allows you to provide a custom location provider.
By using this, you can also get the different information about the coordinates that you get
有关更多信息,请查看本教程:
关于java - Android中获取当前位置方向的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38619091/