gpt4 book ai didi

android - 数据类型 `Location`存储的是什么数据?

转载 作者:行者123 更新时间:2023-11-29 21:43:29 25 4
gpt4 key购买 nike

我正在为 Android 制作一个 GPS 应用程序。我需要知道用户的位置。 location 存储什么样的数据:

位置 location = locationManager.getLastKnownLocation(provider);

我的意思是它存储坐标或城市名称等吗?

最佳答案

根据 Location ,它包含:

A data class representing a geographic location.

A location can consist of a latitude, longitude, timestamp, and other information such as bearing, altitude and velocity.

All locations generated by the LocationManager are guaranteed to have a valid latitude, longitude, and timestamp (both UTC time and elapsed real-time since boot), all other parameters are optional.

是的,您可以使用设备知道的页面中的方法。

参见 Geocoder关于如何查找城市的类(class)。

关于android - 数据类型 `Location`存储的是什么数据?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16501940/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com