LocationCollector

Collector to collect Last Known Location information, this collector will first try to use FusedLocationProviderClient to collect last location data, if FusedLocationProviderClient class not found or failed to retrieve the location, it fallbacks to Android framework Location API to retrieve the last known location. You may need to override this LocationCollector to collect more recent location.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val TAG: String

Functions

Link copied to clipboard
open fun collect(context: Context, listener: FRListener<JSONObject>, container: JSONObject, collectors: List<DeviceCollector>)
Collect the device data with the provided DeviceCollector
open fun collect(context: Context, listener: FRListener<JSONObject>)
Collect the device data.
Link copied to clipboard
private open fun fallback(context: Context, listener: FRListener<JSONObject>)
Fallback to use LocationManager
Link copied to clipboard
open fun getName(): String
Retrieve the name of the Collector
Link copied to clipboard
abstract fun intercept(chain: Interceptor.Chain, data: T)
open fun intercept(chain: Interceptor.Chain, data: JSONObject)
Intercept the chain
Link copied to clipboard
protected open fun result(location: Location): JSONObject
Convert Location to JSONObject