TrapConfig

data class TrapConfig(var reporter: TrapConfig.Reporter = Reporter(), var defaultDataCollection: TrapConfig.DataCollection = DataCollection(), var lowBatteryDataCollection: TrapConfig.DataCollection = DataCollection( collectCoalescedPointerEvents = false, collectCoalescedStylusEvents = false, collectCoalescedTouchEvents = false, collectors = mutableListOf( TrapMetadataCollector(), TrapCoarseLocationCollector(), TrapPointerCollector(), TrapStylusCollector(), TrapTouchCollector(), TrapBatteryCollector() ) ), var lowDataDataCollection: TrapConfig.DataCollection = DataCollection( collectCoalescedPointerEvents = false, collectCoalescedStylusEvents = false, collectCoalescedTouchEvents = false, collectors = mutableListOf( TrapMetadataCollector(), TrapCoarseLocationCollector(), TrapPointerCollector(), TrapStylusCollector(), TrapTouchCollector(), TrapBatteryCollector() ) ), var queueSize: Int = 8192, var sessionIdFilter: String? = null, var lowBatteryThreshold: Float = 10.0f, var enableDataCollection: Boolean = true)

The global configuration for the library.

Constructors

Link copied to clipboard
constructor(reporter: TrapConfig.Reporter = Reporter(), defaultDataCollection: TrapConfig.DataCollection = DataCollection(), lowBatteryDataCollection: TrapConfig.DataCollection = DataCollection( collectCoalescedPointerEvents = false, collectCoalescedStylusEvents = false, collectCoalescedTouchEvents = false, collectors = mutableListOf( TrapMetadataCollector(), TrapCoarseLocationCollector(), TrapPointerCollector(), TrapStylusCollector(), TrapTouchCollector(), TrapBatteryCollector() ) ), lowDataDataCollection: TrapConfig.DataCollection = DataCollection( collectCoalescedPointerEvents = false, collectCoalescedStylusEvents = false, collectCoalescedTouchEvents = false, collectors = mutableListOf( TrapMetadataCollector(), TrapCoarseLocationCollector(), TrapPointerCollector(), TrapStylusCollector(), TrapTouchCollector(), TrapBatteryCollector() ) ), queueSize: Int = 8192, sessionIdFilter: String? = null, lowBatteryThreshold: Float = 10.0f, enableDataCollection: Boolean = true)

Types

Link copied to clipboard
data class DataCollection(var maxNumberOfLogMessagesPerMinute: Int = 100, var accelerationSamplingPeriodMs: Int = 10, var accelerationMaxReportLatencyMs: Int = 200, var gyroscopeSamplingPeriodMs: Int = 10, var gyroscopeMaxReportLatencyMs: Int = 200, var magnetometerSamplingPeriodMs: Int = 10, var magnetometerMaxReportLatencyMs: Int = 200, var gravitySamplingPeriodMs: Int = 10, var gravityMaxReportLatencyMs: Int = 200, var collectCoalescedPointerEvents: Boolean = true, var collectCoalescedStylusEvents: Boolean = true, var collectCoalescedTouchEvents: Boolean = true, var metadataSubmissionInterval: Long, var collectors: List<TrapDatasource> = mutableListOf( TrapAccelerometerCollector(), TrapBluetoothCollector(), TrapGravityCollector(), TrapGyroscopeCollector(), TrapCoarseLocationCollector(), TrapMagnetometerCollector(), TrapPointerCollector(), TrapStylusCollector(), TrapTouchCollector(), TrapWiFiCollector(), TrapBatteryCollector(), TrapMetadataCollector(), ))
Link copied to clipboard
data class Reporter(var url: String = "https://example.com/api/post/{streamId}/{sessionId}", var interval: Long = 1000, var cachedTransport: Boolean = true, var maxFileCacheSize: Long, var sessionId: UUID = UUID(0, 0), var connectTimeout: Int = 500, var readTimeout: Int = 500, var compress: Boolean = false, var apiKeyName: String = "graboxy-api-key", var apiKeyValue: String = "api-key-value")

The configuration for the reporter task serializing and sending the collected data through the transport.

Properties

Link copied to clipboard

Default data collection options.

Link copied to clipboard

Is data collection enabled automatically when the TrapManager is instantiated with this config

Link copied to clipboard

Limited data collection in case of low battery

Link copied to clipboard

Battery charge threshold for low battery status

Link copied to clipboard

Limited data collection in case of low battery

Link copied to clipboard

The size of the circular data queue.

Link copied to clipboard

The configuration for the reporter task.

Link copied to clipboard

SessionId filter, if specified the data collection is only enabled if sessionId <= sessionIdFilter

Functions

Link copied to clipboard
fun initSessionId(application: Application)