Integrating the Android SDK
Give users of your Android app the ability to make convenient in-app payments. It is easy to integrate the Amazon Payment Services mobile payment gateway into your native Android app using our Android SDK.
This section helps you to integrate the Amazon Payment Services mobile SDK for Android devices so that you can offer a safe, trusted in-app payment experience for your Android mobile app.
As an alternative, you may want to consider custom-coding your in-app payment processing by making direct use of our APIs, you can read more about custom integration here.
Android SDK support
The Amazon Payment Services Android SDK supports devices running Android 4.1.x and later (API level 16). In other words, Android Ice Cream Sandwich or higher is supported. This release supports Android Pie API 28. The mobile SDK supports both English and Arabic.
Portrait orientation is the only supported screen orientation. The Amazon Payment Services Android mobile SDK does not support landscape orientation.
Note that the Android mobile SDK does not offer the same range of payment options as our web-based integration routes. This version of the Android mobile SDK can only process payments made with ordinary debit or credit cards. The supported payment card payment options are Visa, Mastercard, American Express, Mada, and Meeza.
Setting up Android integration
To successfully implement the Android SDK you must have some knowledge of Android mobile app development. However, our Android SDK pre-packages much of the code required to enable in-app payment processing on Android.
Note that to process a transaction using the Amazon Payment Services mobile SDK you must first create a mobile SDK authentication token. Once the token is in place you can proceed to process the transaction.
Key configuration steps include:
You need to download the Amazon Payment Services Android SDK from this link. You can select either Android Studio or Eclipse for your development environment.
Once you have downloaded and extracted the Amazon Payment Services Android SDK you can proceed to configure Android Studio or Eclipse. We provide full configuration instructions in the Android SDK integration guide.
Once you have configured your IDE you can proceed to configure the project.
The Amazon Payment Services Android SDK requires specific Android OS permissions to work and you must include the necessary code.
Amazon Payment Service requests are collected via a Java bean. Note that you must always supply the mobile SDK with a unique device ID value.
Device ID permissions
Developers should stay aware of the need for, and the usage of, the permissions requested by the Amazon Payment Services payment SDK to facilitate the generation of a unique device ID.
One goal of the Amazon Payment Services mobile SDK workflow is to acquire a unique ID for the device. It is important to try to generate the device ID based on more than one input: collecting as much information as possible will lead to a highly unique ID.
You might not face this issue through your payment flow. It depends on exactly when you are requesting the getDeviceID function and when you request the permission for the first time.
Refer to our complete Android SDK integration guide, contained in the API reference, for full information
Customizing your Android integration
We provide you with the res folder that includes the source code you require to customize the design, themes, etc of your Android integration. You can customize both English and Arabic layouts as needed. However, there are a few points you should take into consideration.
For example, you can't change the layout name because it is considered an override process. You can only design views for portrait orientation. Landscape orientation is not supported.
You can support as many layout densities as you want. To sum up, you can add any static elements and even redesign the view, but you must keep the elements used in the standard layout -- particularly if the element has an ID.
👆 The customized XML file should be added to the layout file in the target project (Merchant Application) to override the default SDK file.
Go to the full API reference
This page is intended to help you understand how the Android SDK works. Developers should review the full API reference for complete instructions on how to implement our Android SDK, including a full list of parameters and Android-specific instructions.
Need further help?
If you get stuck feel free to get in touch with the Amazon Payment Services team. Just message our support team at email@example.com.