在Android中获取当前位置方向的位置 [英] Getting location of a direction of current location in Android
问题描述
我想实现一个功能,通过手机的方向计算位置列表(经度和纬度)。其结果可能是将拐角指向位置的rectengular形状。
首先,我该如何找到设备当前的方向,这意味着后置摄像头指向哪个方向?我可以通过这个方向获取位置信息列表吗?
谢谢
通过Google Maps Android API的文档,位置Android设备可用的数据包括使用技术组合指定的设备的当前位置 - 移动的方向和方法以及设备是否移动到预定义的地理边界或地理围栏。
这是您可以对您的应用程序执行的3个选项。
$ b
使用我的位置图层,该图层提供了一种在设备上显示设备位置的简单方法。它不提供数据。
- 使用 href =https://developers.google.com/android/reference/com/google/android/gms/maps/LocationSource =nofollow> LocationSource
使用 Google Play服务位置API 对于位置数据的所有程序化请求均建议使用
。
界面允许您提供自定义位置提供程序。
通过使用此功能,您还可以获取有关
坐标的不同信息
有关更多信息,请查看本教程:
I want to implement a function that calculates locations' list (longitudes and latitudes) through a direction of my phone. The result can be a rectengular shape which is pointing the corners as locations.
First how can i find the device current direction which means which direction the back camera points ?
Then how can i obtain a list of location information through this direction ?
Thank you
From the documentation of Google Maps Android API, the location data available to an Android device includes the current location of the device pinpointed using a combination of technologies - the direction and method of movement, and whether the device has moved across a predefined geographical boundary, or geofence.
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
For more information, check this tutorial:
这篇关于在Android中获取当前位置方向的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!