Name:
interface
Value:
Amplify has re-imagined the way frontend developers build fullstack applications. Develop and deploy without the hassle.

Drop-in auth

The AWS SDK for Android entered Maintenance Phase as of August 1, 2025.

During this maintenance period:

  • Critical bug fixes and security patches will continue to be provided
  • No new features or enhancements will be added
  • Existing functionality will remain supported

We recommend that you start using AWS Amplify for Android, our modern feature-rich library designed specifically for building cloud-connected apps powered by AWS. You can refer to the AWS SDK for Android migration guide to help you transition to AWS Amplify for Android.

This version is scheduled to reach End of Support on August 1, 2026. After this date, no further updates of any kind will be provided. See maintenance policy for more information about the Amplify Client Library lifecycle.

The AWSMobileClient client supports a simple "drop-in" UI for your application. You can add drop-in Auth UI like so:

// 'this' refers the current active activity
AWSMobileClient.getInstance().showSignIn(this, new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
Log.d(TAG, "onResult: " + result.getUserState());
}
@Override
public void onError(Exception e) {
Log.e(TAG, "onError: ", e);
}
});

In the above code you would have created an Android Activity called NextActivity which would automatically be navigated to upon successful sign-up and sign-in. For testing, you can alternatively just use MainActivity.class after initializing:

AWSMobileClient.getInstance().showSignIn(
this,
SignInUIOptions.builder()
.nextActivity(NextActivity.class)
.build(),
new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
Log.d(TAG, "onResult: " + result.getUserState());
switch (result.getUserState()){
case SIGNED_IN:
Log.i("INIT", "logged in!");
break;
case SIGNED_OUT:
Log.i(TAG, "onResult: User did not choose to sign-in");
break;
default:
AWSMobileClient.getInstance().signOut();
break;
}
}
@Override
public void onError(Exception e) {
Log.e(TAG, "onError: ", e);
}
}
);

The above code also shows an additional Auth API, signOut(). For more advanced scenarios, you can call the AWSMobileClient APIs, such as for building your own UI or using functionality in different UX of your application lifecycle.

Customization

Currently, you can change the following properties of the drop-in UI with the AWSMobileClient:

  • Logo: Any Drawable resource supported by ImageView
  • Background Color: Any color Android supported
AWSMobileClient.getInstance().showSignIn(
this,
SignInUIOptions.builder()
.nextActivity(NextActivity.class)
.logo(R.id.logo)
.backgroundColor(R.color.black)
.canCancel(false)
.build(),
new Callback<UserStateDetails>() {
@Override
public void onResult(UserStateDetails result) {
Log.d(TAG, "onResult: " + result.getUserState());
}
@Override
public void onError(Exception e) {
Log.e(TAG, "onError: ", e);
}
}
);

You can allow the sign in process to be dismissed by setting the canCancel property.