Runtime Permissions
Your application will need to request some permissions during runtime, otherwise SecurityException will be thrown when accessing certain functions in the SDK. A PermissionsUtil object is provided in the SDK to handle this should you wish to use it. Its usage can be seen throughout the sample application.
The permissions that need to be requested are below:
Bluetooth Permissions
This is applicable if you are using the SDK with ConnectionMode.BLUETOOTH.
val bluetoothPermissions: Array<String> =
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
arrayOf(
Manifest.permission.BLUETOOTH_CONNECT,
Manifest.permission.BLUETOOTH_SCAN,
)
} else {
// Below API 31 (Android 12) BLUETOOTH_ADMIN is automatically
// granted given it is specified in the manifest
arrayOf()
}Location Permissions
These are only required if you want to collect geolocation for transactions (ToroConfig.collectGeolocation is set to true).
val locationPermissions =
arrayOf(
Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION
)USB Permissions
If you are using the SDK with ConnectionMode.USB, permission will be requested as soon as the Miura device is attached to the Android device.
No additional setup is required in your application for this to work.
