MapTrip SDK Android Manual 9.9.7
IwLocationManagerGPS Class Reference

Uses the Android Location provider to update the position in the Map. More...

+ Inheritance diagram for IwLocationManagerGPS:

Public Member Functions

void addListener (IwLocationListener l)
 
void addNmeaListener (NmeaListener nmeaListener)
 
void disableLocationUpdates ()
 
void doBestPossibleUpdate ()
 
boolean enableLocationUpdates ()
 
Location getCurrentLocation ()
 
Position getCurrentWGS84Position ()
 
String getLocationProvider ()
 
boolean isBetterLocation (Location location, Location currentBestLocation)
 
 IwLocationManagerGPS (Context context)
 
void onFirstFix (int ttffMillis)
 
void onFlushComplete (int requestCode)
 
void onGpsStatusChanged (int event)
 
void onLocationChanged (@NonNull List< Location > locations)
 
void onLocationChanged (@NonNull Location location)
 
void onProviderDisabled (String provider)
 
void onProviderEnabled (String provider)
 
void onSatelliteStatusChanged (GnssStatus status)
 
void onStarted ()
 
void onStatusChanged (String provider, int status, Bundle extras)
 
void onStopped ()
 
void reInitLocationProvider ()
 
void removeListener (IwLocationListener l)
 
void setCurrentLocationNotFix ()
 
void uninit ()
 

Static Public Member Functions

static Location getBestPositionFast (Context context)
 
static boolean isNetworkProvider (Location loc)
 
static boolean isSameProvider (String provider1, String provider2)
 

Protected Member Functions

Location makeBadGpsIfEnabled (Location location)
 
void notifyGpsFix (boolean isGPSFix)
 
void notifyGpsStatusChanged (int status, Bundle bundle)
 
void notifyNewGpsLocation (Location location)
 
void passLocationToApi (final Location loc)
 
void setLastReceivedLocation (Location loc)
 

Static Protected Member Functions

static final long getFixTimeMS (Location location)
 

Detailed Description

Usage of this class requires ACCES_FINE_LOCATION Permission

Constructor & Destructor Documentation

◆ IwLocationManagerGPS()

IwLocationManagerGPS ( Context  context)

Member Function Documentation

◆ addListener()

void addListener ( IwLocationListener  l)

on registration send gps Enabled/Disabled callbacks and the last known location

Reimplemented from IwLocationManagerBase.

◆ addNmeaListener()

void addNmeaListener ( NmeaListener  nmeaListener)

add NMEAListener

Parameters
nmeaListener- listener to add

Implements IwLocationManager.

◆ disableLocationUpdates()

void disableLocationUpdates ( )

disable the location manager

Implements IwLocationManager.

◆ doBestPossibleUpdate()

void doBestPossibleUpdate ( )

location manager tries to determine the best possible location and updates the API

Implements IwLocationManager.

◆ enableLocationUpdates()

boolean enableLocationUpdates ( )

enable the location update

Returns
true on success - false if no permission

Implements IwLocationManager.

◆ getBestPositionFast()

static Location getBestPositionFast ( Context  context)
static

◆ getCurrentLocation()

Location getCurrentLocation ( )
inherited
Returns
the last received location

◆ getCurrentWGS84Position()

Position getCurrentWGS84Position ( )
inherited
Returns
the last received location as WGS84

Implements IwLocationManager.

◆ getFixTimeMS()

static final long getFixTimeMS ( Location  location)
staticprotectedinherited

◆ getLocationProvider()

String getLocationProvider ( )
Returns
String - provider for the locations - ( network, gps, log, manual... )

Implements IwLocationManager.

◆ isBetterLocation()

boolean isBetterLocation ( Location  location,
Location  currentBestLocation 
)

◆ isNetworkProvider()

static boolean isNetworkProvider ( Location  loc)
static

◆ isSameProvider()

static boolean isSameProvider ( String  provider1,
String  provider2 
)
static

◆ makeBadGpsIfEnabled()

Location makeBadGpsIfEnabled ( Location  location)
protectedinherited

Adds noise to a given location

Parameters
location- location to add noise to
Returns
location with added noise

◆ notifyGpsFix()

void notifyGpsFix ( boolean  isGPSFix)
protectedinherited

notify listeners about a gps fix

Parameters
isGPSFixif true, a fix is found if false it is lost

◆ notifyGpsStatusChanged()

void notifyGpsStatusChanged ( int  status,
Bundle  bundle 
)
protectedinherited

notify listener about status changed

◆ notifyNewGpsLocation()

void notifyNewGpsLocation ( Location  location)
protectedinherited

notify listeners about a new gps location

Parameters
location- the new received location

◆ onFirstFix()

void onFirstFix ( int  ttffMillis)

◆ onFlushComplete()

void onFlushComplete ( int  requestCode)

◆ onGpsStatusChanged()

void onGpsStatusChanged ( int  event)

◆ onLocationChanged() [1/2]

void onLocationChanged ( @NonNull List< Location >  locations)
inherited

◆ onLocationChanged() [2/2]

void onLocationChanged ( @NonNull Location  location)

◆ onProviderDisabled()

void onProviderDisabled ( String  provider)
inherited

◆ onProviderEnabled()

void onProviderEnabled ( String  provider)
inherited

◆ onSatelliteStatusChanged()

void onSatelliteStatusChanged ( GnssStatus  status)

◆ onStarted()

void onStarted ( )

◆ onStatusChanged()

void onStatusChanged ( String  provider,
int  status,
Bundle  extras 
)

Reimplemented from IwLocationManagerBase.

◆ onStopped()

void onStopped ( )

◆ passLocationToApi()

void passLocationToApi ( final Location  loc)
protectedinherited

Passes the given location to the msm API in a queueApiCall

Parameters
locto pass

◆ reInitLocationProvider()

void reInitLocationProvider ( )

Search for best possible provider and calls disableLocationUpdates internal To get new location updates after this enableLocationUpdates must be called.

Implements IwLocationManager.

◆ removeListener()

void removeListener ( IwLocationListener  listener)
inherited

remove location listener

Parameters
listener- listener to remove

Implements IwLocationManager.

◆ setCurrentLocationNotFix()

void setCurrentLocationNotFix ( )
inherited

pass the current location with bad to the api so that the position icon appears grey e.g. if there is no further GPS for a time or GPS gets deactivate this Method can be used to indicate

Implements IwLocationManager.

◆ setLastReceivedLocation()

void setLastReceivedLocation ( Location  loc)
protectedinherited

store last received location

Parameters
loc- location to set

◆ uninit()

void uninit ( )
inherited

clear listener


The documentation for this class was generated from the following file: