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
A Context of your application / activity / service. This context does not need to be an activity, it can be any context of your application.
Functions
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.
Creates an instance of SOCommOutsideAPI with the parameters defined on this SOCommOutsideAPIBuilder object.
Creates an instance of SOCommOutsideAPI with the parameters defined on this SOCommOutsideAPIBuilder object for special API access (wifi-only).
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)
If you want enable warning-logs to be logged, provide a lambda here.
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.