This project is a simple demonstration of Login with Amazon (LwA) SDK implementation on for below devices:
- Amazon Fire tablets
- Amazon Fire TV's
- Non Amazon Devices
This sample app demonstrates how to integrate 'Login with Amazon' in an Android application. Users can authenticate using their Amazon credentials and view their profile information within the app.
- Amazon OAuth 2.0 Authentication: Secure login using Amazon credentials.
- Profile Retrieval: Fetch and display the user's Amazon profile information post-login.
- Responsive UI: Optimized for both smartphones and tablets.
To run this app, you'll need to do the following:
- Install the latest version of Android Studio.
- Sign up for Amazon Developer account.
- Download the Amazon LwA Mobile SDK.
- Download the Login with Amazon button.
Clone the project to your local machine:
git clone https://github.com/AmazonAppDev/login-with-amazon-sample.git
- Sign in to the Amazon Developer Console.
- Create a new security profile.
- Create an API key.
- Store the API key in a new text file named as api_key.txt for later use.
- Open the project in Android Studio.
- Go into project view.
- Navigate to app -> libs.
- Right click jar file and add as library.
- Navigate to app -> src -> assets.
- Add api_key.txt file into the folder.
- Add JAR file in project found in Amazon LwA Mobile SDK downloaded as prerequisite.
- Extract the zip file libs->login-with-amazon-sdk.jar(copy from amazon LwA Mobile SDK).
- Add login-with-amazon-sdk.jar file into the app -> libs folder in the project.
- Add Login with Amazon button image into the app -> res -> drawable folder in the project. Also add the pressed version as well.
- Rename the image as btnlwa_gold_loginwithamazon to successfully load in layout.
- In Android Studio, select 'Build' > 'Make Project'.
- Choose 'Run' > 'Run app' to launch the app on your device or emulator.
After launching the app, tap on the 'Login with Amazon' button. Enter your Amazon credentials, and upon successful authentication, the app will display your Amazon profile name and email.
- Login Failure: Ensure your API key and package name in Amazon Developer Console match those in your project.
- Network Issues: Verify your internet connection and Amazon service availability.
If you found a bug or want to suggest a new [feature/use case/sample], please file an issue.
If you have questions or need help with code, make sure to ask in our Appstore developer community Q&A category. In addition, we are available at
- on X at @AmazonAppDev
- on Stack Overflow at the amazon-appstore tag
Get the most up to date Amazon Appstore developer news, product releases, tutorials, and more:
- ๐ฃ Follow @AmazonAppDev
- ๐บ Subscribe to our Youtube channel
- ๐ง Sign up for the Developer Newsletter