Skip to content

Most visited

Recently visited

navigation
Added in API level 3

GpsStatus

public final class GpsStatus
extends Object

java.lang.Object
   ↳ android.location.GpsStatus


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

Summary

Nested classes

interface GpsStatus.Listener

Used for receiving notifications when GPS status has changed. 

interface GpsStatus.NmeaListener

Used for receiving NMEA sentences from the GPS. 

Constants

int GPS_EVENT_FIRST_FIX

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

int GPS_EVENT_SATELLITE_STATUS

Event sent periodically to report GPS satellite status.

int GPS_EVENT_STARTED

Event sent when the GPS system has started.

int GPS_EVENT_STOPPED

Event sent when the GPS system has stopped.

Public methods

int getMaxSatellites()

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

Iterable<GpsSatellite> getSatellites()

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

int getTimeToFirstFix()

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

Inherited methods

From class java.lang.Object

Constants

GPS_EVENT_FIRST_FIX

Added in API level 3
int GPS_EVENT_FIRST_FIX

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

Constant Value: 3 (0x00000003)

GPS_EVENT_SATELLITE_STATUS

Added in API level 3
int GPS_EVENT_SATELLITE_STATUS

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

Constant Value: 4 (0x00000004)

GPS_EVENT_STARTED

Added in API level 3
int GPS_EVENT_STARTED

Event sent when the GPS system has started.

Constant Value: 1 (0x00000001)

GPS_EVENT_STOPPED

Added in API level 3
int GPS_EVENT_STOPPED

Event sent when the GPS system has stopped.

Constant Value: 2 (0x00000002)

Public methods

getMaxSatellites

Added in API level 3
int getMaxSatellites ()

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

Returns
int the maximum number of satellites

getSatellites

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

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

Returns
Iterable<GpsSatellite> the list of satellites

getTimeToFirstFix

Added in API level 3
int getTimeToFirstFix ()

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

Returns
int time to first fix in milliseconds
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.