java - Android中获取当前位置方向的位置

标签 java android google-maps location direction

我想实现一个通过手机方向计算位置列表(经度和纬度)的功能。结果可以是一个矩形形状,将角点作为位置。

首先,我如何找到设备当前方向,即后置摄像头指向哪个方向?

那么如何通过这个方向获取位置信息列表呢?

谢谢

最佳答案

来自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/

相关文章:

java - 如何在 web-inf/class 下的类命名空间中创建/写入文件

android external/STLport include in Android.mk build not successfull

android - Google Maps Android API v2 - 检测长按 map AlertDialog

java - 使用 Apache Pulsar 和 Spring Boot 自定义对象

java - 我的 Android 类中的 Arraylist 错误

android - 使用 Android BillingClient 2.1 检索应用内购买,返回空列表

google-maps - 使用 Flutter Google Maps 插件自定义标记

google-maps - 我的 flutter Assets 图像没有被用作谷歌地图的标记图标

c# - ushort 等价物

java - 安卓.view.InflateException : Binary XML file line #9: Error inflating class <unknown>