public class BlueetoothGpsManager
extends java.lang.Object
构造器和说明 |
---|
BlueetoothGpsManager(android.app.Service callingService,
java.lang.String deviceAddress,
int maxRetries) |
限定符和类型 | 方法和说明 |
---|---|
boolean |
addNmeaListener(android.location.GpsStatus.NmeaListener listener)
Adds an NMEA listener.
|
void |
disable()
Disables the bluetooth GPS provider.
|
void |
disable(int reasonId)
Disables the bluetooth GPS provider.
|
void |
disableMockLocationProvider()
Disables the current Mock GPS Location Provider used for the bluetooth GPS.
|
boolean |
enable()
Enables the bluetooth GPS Provider.
|
void |
enableMockLocationProvider(java.lang.String gpsName)
Enables the Mock GPS Location Provider used for the bluetooth GPS.
|
void |
enableMockLocationProvider(java.lang.String gpsName,
boolean force)
Enables the Mock GPS Location Provider used for the bluetooth GPS.
|
int |
getDisableReason() |
java.lang.String |
getMockLocationProvider()
Getter for the name of the current Mock Location Provider in use.
|
android.location.Location |
GetNemaLocation() |
boolean |
isEnabled() |
boolean |
isMockGpsEnabled()
Getter use to know if the Mock GPS Listener used for the bluetooth GPS is enabled or not.
|
void |
removeNmeaListener(android.location.GpsStatus.NmeaListener listener)
Removes an NMEA listener.
|
void |
sendNmeaCommand(java.lang.String sentence)
Sends a NMEA sentence to the bluetooth GPS.
|
void |
sendPackagedNmeaCommand(java.lang.String command)
Sends a NMEA sentence to the bluetooth GPS.
|
public BlueetoothGpsManager(android.app.Service callingService, java.lang.String deviceAddress, int maxRetries)
callingService
- deviceAddress
- maxRetries
- public int getDisableReason()
public boolean isEnabled()
public boolean enable()
public void disable(int reasonId)
reasonId
- the reason to close the bluetooth provider.public void disable()
public void enableMockLocationProvider(java.lang.String gpsName, boolean force)
gpsName
- the name of the Location Provider to use for the bluetooth GPSforce
- true if we want to force auto-activation of the mock location provider (and bypass user preference).enableMockLocationProvider(String)
public void enableMockLocationProvider(java.lang.String gpsName)
gpsName
- the name of the Location Provider to use for the bluetooth GPSenableMockLocationProvider(String)
public void disableMockLocationProvider()
public boolean isMockGpsEnabled()
NmeaParser.isMockGpsEnabled()
public java.lang.String getMockLocationProvider()
NmeaParser.getMockLocationProvider()
public boolean addNmeaListener(android.location.GpsStatus.NmeaListener listener)
listener
- a GpsStatus.NmeaListener
object to registeraddNmeaListener(NmeaListener)
public void removeNmeaListener(android.location.GpsStatus.NmeaListener listener)
listener
- a GpsStatus.NmeaListener
object to removeremoveNmeaListener(NmeaListener)
public void sendPackagedNmeaCommand(java.lang.String command)
command
- the complete NMEA sentence (i.e. $....*XY where XY is the checksum).public void sendNmeaCommand(java.lang.String sentence)
sentence
- the NMEA sentence without the first "$", the last "*" and the checksum.public android.location.Location GetNemaLocation()