For testing purposes, you can run this from your MainActivity's `onCreate` method.

<BlockSwitcher>
<Block name="Java">

```java
import android.util.Log;
import com.amplifyframework.core.Amplify;
```

```java
Amplify.Auth.fetchAuthSession(
    result -> Log.i("AmplifyQuickstart", result.toString()),
    error -> Log.e("AmplifyQuickstart", error.toString())
);
```

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

```kotlin
import android.util.Log
import com.amplifyframework.core.Amplify
```

```kotlin
Amplify.Auth.fetchAuthSession(
    { Log.i("AmplifyQuickstart", "Auth session = $it") },
    { error -> Log.e("AmplifyQuickstart", "Failed to fetch auth session", error) }
)
```

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

```kotlin
import android.util.Log
import com.amplifyframework.auth.AuthException
import com.amplifyframework.kotlin.core.Amplify
```

```kotlin
try {
    val session = Amplify.Auth.fetchAuthSession()
    Log.i("AmplifyQuickstart", "Auth session = $session")
} catch (error: AuthException) {
    Log.e("AmplifyQuickstart", "Failed to fetch auth session", error)
}
```

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

```java
import android.util.Log;
import com.amplifyframework.rx.RxAmplify;
```

 ```java
RxAmplify.Auth.fetchAuthSession()
    .subscribe(
        result -> Log.i("AmplifyQuickstart", result.toString()),
        error -> Log.e("AmplifyQuickstart", error.toString())
    );
```

</Block>
</BlockSwitcher>
