Most visited

Recently visited

Added in API level 3
Deprecated since API level 24

GpsStatus

public final class GpsStatus
extends Object

java.lang.Object
    android.location.GpsStatus


此类在API级别24中已被弃用。
使用GnssStatusGnssStatus.Callback

这个类表示GPS引擎的当前状态。

该类与 GpsStatus.Listener接口配合使用。

摘要(Summary)

Nested classes

interface GpsStatus.Listener

此接口在API级别24中已弃用。 GnssStatus.Callback改为使用GnssStatus.Callback

interface GpsStatus.NmeaListener

此接口在API级别24中已弃用。 OnNmeaMessageListener改为使用OnNmeaMessageListener

常量(Constants)

int GPS_EVENT_FIRST_FIX

GPS系统自启动以来收到第一次修复时发送的事件。

int GPS_EVENT_SATELLITE_STATUS

定期发送事件以报告GPS卫星状态。

int GPS_EVENT_STARTED

GPS系统启动时发送的事件。

int GPS_EVENT_STOPPED

GPS系统停止时发送的事件。

公共方法(Public methods)

int getMaxSatellites()

返回卫星列表中可以返回 getSatellites()的最大卫星数量。

Iterable<GpsSatellite> getSatellites()

返回一个 GpsSatellite对象的数组,它表示GPS引擎的当前状态。

int getTimeToFirstFix()

返回自最近重新启动GPS引擎以来接收第一个修复程序所需的时间。

继承方法(Inherited methods)

From class java.lang.Object

常量(Constants)

GPS_EVENT_FIRST_FIX

Added in API level 3
int GPS_EVENT_FIRST_FIX

GPS系统自启动以来收到第一次修复时发送的事件。 致电getTimeToFirstFix()查找从开始到第一次修复的时间。

常量值:3(0x00000003)

GPS_EVENT_SATELLITE_STATUS

Added in API level 3
int GPS_EVENT_SATELLITE_STATUS

定期发送事件以报告GPS卫星状态。 致电getSatellites()检索每个卫星的状态。

常量值:4(0x00000004)

GPS_EVENT_STARTED

Added in API level 3
int GPS_EVENT_STARTED

GPS系统启动时发送的事件。

常数值:1(0x00000001)

GPS_EVENT_STOPPED

Added in API level 3
int GPS_EVENT_STOPPED

GPS系统停止时发送的事件。

常量值:2(0x00000002)

公共方法(Public methods)

getMaxSatellites

Added in API level 3
int getMaxSatellites ()

返回卫星列表中可以返回 getSatellites()的最大卫星数量。

返回(Returns)
int the maximum number of satellites

getSatellites

Added in API level 3
Iterable<GpsSatellite> getSatellites ()

返回一个包含 GpsSatellite对象的数组,它们表示GPS引擎的当前状态。

返回(Returns)
Iterable<GpsSatellite> the list of satellites

getTimeToFirstFix

Added in API level 3
int getTimeToFirstFix ()

返回自最近重新启动GPS引擎以来接收第一个修复程序所需的时间。

返回(Returns)
int time to first fix in milliseconds

Hooray!