Added in API level 3
Deprecated in API level 24

GpsStatus

class GpsStatus
kotlin.Any
   ↳ android.location.GpsStatus

This class represents the current state of the GPS engine and is used in conjunction with GpsStatus.Listener.

Summary

Nested classes
abstract

Used for receiving notifications when GPS status has changed.

abstract

Used for receiving NMEA sentences from the GPS.

Constants
static Int

Event sent when the GPS system has received its first fix since starting.

static Int

Event sent periodically to report GPS satellite status.

static Int

Event sent when the GPS system has started.

static Int

Event sent when the GPS system has stopped.

Public methods
static GpsStatus
create(gnssStatus: GnssStatus, timeToFirstFix: Int)

Builds a GpsStatus from the given GnssStatus.

Int

Returns the maximum number of satellites that can be in the satellite list that can be returned by getSatellites().

MutableIterable<GpsSatellite!>!

Returns an array of GpsSatellite objects, which represent the current state of the GPS engine.

Int

Returns the time required to receive the first fix since the most recent restart of the GPS engine.

Constants

GPS_EVENT_FIRST_FIX

Added in API level 3
static val GPS_EVENT_FIRST_FIX: Int

Deprecated: Deprecated in Java.

Event sent when the GPS system has received its first fix since starting. Call getTimeToFirstFix() to find the time from start to first fix.

Value: 3

GPS_EVENT_SATELLITE_STATUS

Added in API level 3
static val GPS_EVENT_SATELLITE_STATUS: Int

Deprecated: Deprecated in Java.

Event sent periodically to report GPS satellite status. Call getSatellites() to retrieve the status for each satellite.

Value: 4

GPS_EVENT_STARTED

Added in API level 3
static val GPS_EVENT_STARTED: Int

Deprecated: Deprecated in Java.

Event sent when the GPS system has started.

Value: 1

GPS_EVENT_STOPPED

Added in API level 3
static val GPS_EVENT_STOPPED: Int

Deprecated: Deprecated in Java.

Event sent when the GPS system has stopped.

Value: 2

Public methods

create

Added in API level 30
Deprecated in API level 24
static fun create(
    gnssStatus: GnssStatus,
    timeToFirstFix: Int
): GpsStatus

Deprecated: Deprecated in Java.

Builds a GpsStatus from the given GnssStatus.

Parameters
gnssStatus GnssStatus: This value cannot be null.
Return
GpsStatus This value cannot be null.

getMaxSatellites

Added in API level 3
fun getMaxSatellites(): Int

Deprecated: Deprecated in Java.

Returns the maximum number of satellites that can be in the satellite list that can be returned by getSatellites().

Return
Int the maximum number of satellites

getSatellites

Added in API level 3
fun getSatellites(): MutableIterable<GpsSatellite!>!

Deprecated: Deprecated in Java.

Returns an array of GpsSatellite objects, which represent the current state of the GPS engine.

Return
MutableIterable<GpsSatellite!>! the list of satellites

getTimeToFirstFix

Added in API level 3
fun getTimeToFirstFix(): Int

Deprecated: Deprecated in Java.

Returns the time required to receive the first fix since the most recent restart of the GPS engine.

Return
Int time to first fix in milliseconds