Developer Console
In-App Purchasing

Collapse All | Expand All


Other Resources

Get Started with Appstore SDK IAP

Use the following procedure to get started with In-App Purchasing (IAP) using the sample apps included in the Appstore SDK. For detailed instructions on how to implement the IAP API, see Implement Appstore SDK IAP.

1. Download the Appstore SDK

You can download the Appstore SDK here:

The download includes the IAP JAR file, API documentation, and Java sample apps.

2. Set up sample apps in Android Studio

If you are using Android Studio as your IDE, you can import the sample projects, export them as APKs and run them on an Android device.

To use a Kotlin sample app, clone or download the IAP Kotlin sample app from GitHub here:

For Java sample apps, follow these steps:

  1. Extract the contents of the Appstore_SDK_<version>.zip file somewhere to your local machine.
  2. Start Android Studio and import the IAP sample apps to your workspace:
    1. On the Welcome to Android Studio screen, from the More Actions menu (the three stacked dots in the upper right) select Import Project (Eclipse ADT, Gradle, etc.) to open a project import window.
      Or from within Android Studio, select File > New > Import Project.
    2. Navigate to the location where you extracted the contents of the SDK zip file, and expand the /Appstore_SDK_<version>/examples directory.
    3. Select the folder for one of the IAP sample projects, and click OK.
    4. Repeat these steps for each sample app.
  3. Generate the APK for one of the sample apps:
    1. Enable developer options and USB debugging on your Android mobile device, and connect the device to your development computer. For help with connecting your device, see Connect to Fire Tablet through ADB.
    2. In Android Studio, select Run > Run 'app' to install the app to that device.

You should now be able to run this sample app on your mobile device.

When submitting your actual app to the Amazon Appstore, an Amazon signature will be applied to your app, regardless of whether you submit a signed or unsigned APK.

3. Set up App Tester

Amazon provides an App Tester tool for performing unit testing of IAP. You can test out this tool with the IAP sample apps.

To install the App Tester and enable the sample app to run on the App Tester:

  1. Follow the instructions in Installing and Configuring the App Tester.
  2. From the sample app, using the adb push command, copy the amazon.sdktester.json file to the /mnt/sdcard/amazon.sdktester.json path on your device:

    $ adb push <_Your_JSON_File_Folder_>/amazon.sdktester.json /mnt/sdcard/
    
  3. Follow the instructions in the App Tester User Guide to learn more about testing an app with App Tester. If you need help setting up the test cases to check with the App Tester, see Defining and Executing Test Cases for IAP.

4. Submit your app and in-app items

After you finish testing your app, you can submit your app and in-app items to Amazon.

See Create and Submit IAP Items.


Last updated: May 22, 2024