Preface
This chapter is about android. location. gpsStatus, for GPS related chapter, version for Android 3.2 r1, translated from "pandatv 82", welcome to visit his blog: "http://wisekingokok.cnblogs.com", thanks again "pandatv 82 "! Welcome to join in Android Chinese translation, contact me over140@gmail.com.
Statement
You are welcome to repost, but please keep the original source of the article :)
Blog Garden: http://www.cnblogs.com/
Android Chinese translation group: http://goo.gl/6vJQl
GpsStatus
Translator's signature: pandatv 82
Link: http://wisekingokok.cnblogs.com
Version: Android 3.2 r1
Structure
Inheritance relationship
Public final class GpsStatus extends Object
Java. lang. Object
Android. location. GpsStatus
Class Overview
This class is used to express the current status of the GPS engine. This class must be used in conjunction with the GpsStatus. Listener interface.
Constant
IntGPS_EVENT_FIRST_FIX
This event code is sent when the GPS system module receives the first GPS location information. Call the getTimeToFirstFix () method to obtain the time it takes to enable the self-GPS system module to locate it for the first time.
Constant Value: 3 (0x00000003)
IntGPS_EVENT_SATELLITE_STATUS
Periodically send the Event code of the GPS satellite status. Call getSatellites () to obtain the status of each satellite. (Note: This event code is sent only after the satellite status is obtained. This event code is not sent when no satellite is found .)
Constant Value: 4 (0x00000004)
IntGPS_EVENT_STARTED
This event code is sent when the GPS system module is enabled.
Constant Value: 1 (0x00000001)
IntGPS_EVENT_STOPPED
This event code is sent when the GPS system module is disabled.
Constant Value: 2 (0x00000002)
Internal class
InterfaceGpsStatus. Listener
Receives notifications when the GPS status changes.
InterfaceGpsStatus. NmeaListener
Receives NMEA information from GPS.
Common Methods
Public intGetMaxSatellites()
Returns the maximum number of satellites returned by the getSatellites () method.
Return Value
Maximum number of satellites.
Public Iterable <GpsSatellite>GetSatellites()
Returns a set of satellite objects used to describe the current state of the GPS engine.
Return Value
A group of satellite objects.
Public intGetTimeToFirstFix()
Returns the time required for the first position received since the GPS engine was last started.
Return Value
Time required for first Positioning
Supplement
Article Selection
Baidu encyclopedia GPS
Android positioning function (1)
Android positioning function (2)
GpsStatus. Listener
Translator's signature: pandatv 82
Link: http://wisekingokok.cnblogs.com
Version: Android 3.2 r1
Structure
Inheritance relationship
Public static interface GpsStatus. Listener
Android. location. GpsStatus. Listener
Class Overview
It is used to receive notifications when the GPS status changes.
Common Methods
Public abstract voidOnGpsStatusChanged(Int event)
This method is called back when the GPS status changes. When the GPS status changes, one of the following four event codes is sent:
* GPS_EVENT_STARTED
* GPS_EVENT_STOPPED
* GPS_EVENT_FIRST_FIX
* GPS_EVENT_SATELLITE_STATUS
You can call getGpsStatus (Gpsstatus) inside the method to obtain GPS status information.
Parameters
The event code when the event GPS status changes.
GpsStatus. NmeaListener
Translator's signature: pandatv 82
Link: http://wisekingokok.cnblogs.com
Version: Android 3.2 r1
Structure
Inheritance relationship
Public static interface GpsStatus. NmeaListener
Android. location. GpsStatus. NmeaListener
Class Overview
Used to obtain NMEA information from GPS. NMEA 0183 is a standard for communication with marine electronic devices. It is a common method to receive data from GPS through a series of interfaces. For more details, see NMEA0183. You can implement this interface and call addNmeaListener (GpsStatus. NmeaListener) to receive NMEA data from the GPS engine. Here the NMEA-0183 protocol is generally referred to as the GPS protocol, see here .)
Common Methods
Public abstract voidOnNmeaReceived(Long timestamp, String nmea)
(Note: The original Article does not have a description. This method of this interface seems to be a reserved specification. It has tracked the source code and found that nmea_callback code is added at the hardware access layer before data can be uploaded to the upper layer of the application.
Parameters
Timestamp, in milliseconds.
Nmea information.
)