---
title: Runtime Permissions
slug: runtime-permissions
docTags: 
createdAt: 2024-11-27T11:46:00.454Z
---

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`.

:::CodeblockTabs
```kotlin
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()
    }
```

```java
String[] bluetoothPermissions;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
    bluetoothPermissions = new String[]{
        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
    bluetoothPermissions = new String[]{};
}
```
:::

### Location Permissions

These are only required if you want to collect geolocation for transactions (`ToroConfig.collectGeolocation` is set to `true`).

:::CodeblockTabs
```kotlin
val locationPermissions =
        arrayOf(
            Manifest.permission.ACCESS_FINE_LOCATION,
            Manifest.permission.ACCESS_COARSE_LOCATION
        )
```

```java
String[] locationPermissions = new String[]{
    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.

::Image[]{src="https://api.archbee.com/api/optimize/NWfX_cs_B_73KTvNy1ETb/aFCJt85gowuFq5x0JSp6w_toro-usb-permission-request.png" size="50" width="1080" height="2340" position="center" caption="USB Permission Request" alt="USB Permission Request" darkWidth="1080" darkHeight="2340" showCaption="true"}

