在Android中获取当前位置方向的位置 [英] Getting location of a direction of current location in Android

查看:565
本文介绍了在Android中获取当前位置方向的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

首先,我该如何找到设备当前的方向,这意味着后置摄像头指向哪个方向?我可以通过这个方向获取位置信息列表吗?



谢谢

解决方案

通过Google Maps Android API的文档,位置Android设备可用的数据包括使用技术组合指定的设备的当前位置 - 移动的方向和方法以及设备是否移动到预定义的地理边界或地理围栏。


这是您可以对您的应用程序执行的3个选项。
$ b



通过使用此功能,您还可以获取有关
坐标的不同信息

有关更多信息,请查看本教程:


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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆