public interface

LocationSource

com.steerpath.sdk.location.LocationSource
Known Indirect Subclasses

Class Overview

A location source provides location updates to a listener through the LocationSource.OnLocationChangedListener object's onUpdate method.

Inspired by Google Play Service's similar interface.

Difference between LocationSource and LocationProvider:

LocationSource:
- instance of LocationSource can be assigned to single subsystem, such as SteerpathMapView or GeofencingApi. These subsystems are not talking to each other directly through LocationSource, so if Location updates for both subsystems needs to synchronized, same instance of LocationSource needs to be set to both with setLocationSource().

LocationProvider:
- LocationProvider on the other hand, can se set to LocationServices, which affects positioning globally. Instead of using Steerpath's Bluetooth-based positioning, you can use custom LocationProvider, for example one that loops through GeoJson FeatureCollection and gives Location updates from those coordinates. However, Steerpath Telemetry Service will always use FusedLocationProviderApi as its positioning engine.

Summary

Nested Classes
interface LocationSource.OnLocationChangedListener OnLocationChangedListener is used for receiving updates when a location changes. 
Fields
public static final LocationSource NullLocationSource The NullLocationSource is a location source which will never provide a location.
Public Methods
abstract void activate(LocationSource.OnLocationChangedListener listener)
Call this method to start receiving updates on the listener's onLocationChanged() method.
abstract void deactivate()
This method stops the location source and no more calls to the onLocationChanged() method provided in activate will be called.

Fields

public static final LocationSource NullLocationSource

The NullLocationSource is a location source which will never provide a location. It is useful for example to be provided to SteerpathMap if you want to manually call updateLocation instead of using a location source.

Public Methods

public abstract void activate (LocationSource.OnLocationChangedListener listener)

Call this method to start receiving updates on the listener's onLocationChanged() method.

public abstract void deactivate ()

This method stops the location source and no more calls to the onLocationChanged() method provided in activate will be called. Internally, implementations should discard all resources when deactivate is called.