Location Utils
class LocationUtils
Content copied to clipboard
author: Blankj
blog : http://blankj.com
time : 16/11/13
desc : 定位相关工具类
Types
OnLocationChangeListener
Link copied to clipboard
interface OnLocationChangeListener
Content copied to clipboard
Functions
getAddress
Link copied to clipboard
getCountryName
Link copied to clipboard
getLocality
Link copied to clipboard
isBetterLocation
Link copied to clipboard
open fun isBetterLocation(newLocation: Location, currentBestLocation: Location): Boolean
Content copied to clipboard
isGpsEnabled
Link copied to clipboard
isLocationEnabled
Link copied to clipboard
isSameProvider
Link copied to clipboard
openGpsSettings
Link copied to clipboard
register
Link copied to clipboard
open fun register(minTime: Long, minDistance: Long, listener: LocationUtils.OnLocationChangeListener): Boolean
Content copied to clipboard
注册 使用完记得调用unregister需添加权限
{@code }
需添加权限 {@code }
需添加权限 {@code * }
如果{@code * minDistance}
为0,则通过{@code minTime}
来定时更新;{@code minDistance}
不为0,则以{@code * minDistance}
为准;两者都为0,则随时刷新。unregister
Link copied to clipboard