Amazon Cognito
Developer Guide

Adding an Android App to Amazon Cognito User Pools

Amazon Cognito User Pools allow your applications to register and authenticate users. You can change passwords for authenticated users and initiate forgotten password flows for unauthenticated users. The following section provides setup information and examples so you can use the Amazon Cognito Identity Provider to retrieve and update user pool profiles. These instructions are written for Android application development in Android Studio.

To get started see AWS Mobile SDK for Android and the Mobile SDK for Android documentation.

If you are a React Native developer then add user pools to your React Native applications with the AWS Amplify Library for React Native which includes the Amazon Cognito Identity Provider. For more information see Set Up the AWS Amplify Library for React Native. See also AWS Amplify Library Authentication Guide.

Gradle Dependencies

Add the these dependencies in your app's Gradle file:

  • AWS Android Core SDK (aws-android-sdk-core-x.x.x.jar): Add the latest version of the AWS Android Core as the aws-android-sdk-core-2.2.8.jar as a dependency library to your project's build Gradle.

  • AWS Cognito Identity Provider Android SDK (aws-android-sdk-cognitoidentityprovider:2.3.8.jar): Add the latest version of the Android SDK for Cognito Identity Provider in your app's build Gradle.

Network Permissions

To allow your app to make network calls to talk to the AWS Cognito Identity Provider, you need to enable your app to perform network operations.

Include the following permissions in your app's manifest file:

<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />