SOCommOutsideAPIBuilder

Builder to create instances of SOCommOutsideAPI. Use this builder to instantiate the SOCommOutsideAPI.

Only use one instance of an SOCommOutsideAPI at a time (it should be enough to create one instance of the SOCommOutsideAPI per lifecycle (of your application / service)).

An example usage of the builder would be:

SOCommOutsideAPIBuilder(androidContext())
.apiKey("YOUR-API-KEY") //theoretically optional, however, you won't be able to do much on the remote device without a valid API KEY.
.debugLogs { tag, message -> Log.d(tag, message) } //optional, should only be enabled in debug builds, and might just flood your logcat.
.warningLogs { tag, message -> Log.w(tag, message) } //optional, will log only warnings, you need to decide whether you want to log warnings to somewhere (even in your production code)
.errorLogs { tag, message -> Log.e(tag, message) } //optional, will log only errors, you need to decide whether you want to log errors to somewhere (even in your production code)
.build()

Parameters

context

A Context of your application / activity / service. This context does not need to be an activity, it can be any context of your application.

Constructors

Link copied to clipboard
constructor(context: Context)

Functions

Link copied to clipboard

The API KEY for the remote device to authenticate this SDK on the remote device. This apiKey will be used to authenticate when connecting to the remote device.

Link copied to clipboard

Creates an instance of SOCommOutsideAPI with the parameters defined on this SOCommOutsideAPIBuilder object.

Link copied to clipboard

Creates an instance of SOCommOutsideAPI with the parameters defined on this SOCommOutsideAPIBuilder object for special API access (wifi-only).

Link copied to clipboard
fun debugLogs(sink: (tag: String, message: String) -> Unit?): SOCommOutsideAPIBuilder

If you want enable debug-logs to be logged, provide a lambda here.

Link copied to clipboard
fun errorLogs(sink: (tag: String, message: String) -> Unit?): SOCommOutsideAPIBuilder

If you want enable error-logs to be logged, provide a lambda here.

Link copied to clipboard

If set to true, will use a custom dialog to prompt users to enable WIFI instead of the vendor provided dialog. Default: false (will use the default vendor dialog by default)

Link copied to clipboard
fun warningLogs(sink: (tag: String, message: String) -> Unit?): SOCommOutsideAPIBuilder

If you want enable warning-logs to be logged, provide a lambda here.

Link copied to clipboard

A wifi connection will be established when using a WIFI context, and will be teared down again after the last wifi context has been released.