<BlockSwitcher>
<Block name="Java">

```java
Amplify.Auth.fetchDevices(
    devices -> {
        for (AuthDevice device : devices) {
            Log.i("AuthQuickStart", "Device: " + device);
        }
    },
    error -> Log.e("AuthQuickStart", "Fetch devices failed with error: " + error.toString()));
```

</Block>
<Block name="Kotlin - Callbacks">

```kotlin
Amplify.Auth.fetchDevices(
    { devices ->
        devices.forEach { Log.i("AuthQuickStart", "Device: " + it) }
    },
    { Log.e("AuthQuickStart", "Fetch devices failed with error", it) }
)
```

</Block>
<Block name="Kotlin - Coroutines">

```kotlin
try {
    Amplify.Auth.fetchDevices().forEach { device ->
        Log.i("AuthQuickStart", "Device: $device")
    }
} catch (error: AuthException) {
    Log.e("AuthQuickStart",  "Fetch devices failed with error", error)
}
```

</Block>
<Block name="RxJava">

```java
RxAmplify.Auth.fetchDevices()
    .subscribe(
        device -> Log.i("AuthQuickStart", "Device: " + device);
        error -> Log.e("AuthQuickStart", "Fetch devices failed with error: " + error.toString())
    );
```

</Block>
</BlockSwitcher>
