getInstance

fun getInstance(context: Context, isNeverForLocationFlagSet: Boolean): NativeAndroidEnvironment

Creates or returns the singleton instance of the Android native environment.

Important

When first time created, the environment registers a BroadcastReceiver to listen to Bluetooth state changes. Make sure to call close to unregister the receiver.

Return

The singleton instance of the environment.

Parameters

context

The Android context, used to access system services. This can be any Context, as only the Context.getApplicationContext will be used.

isNeverForLocationFlagSet

Whether the app is not using results of Bluetooth LE scanning to estimate device location. This should be set if the BLUETOOTH_SCAN permission is declared with neverForLocation flag.