Developer Console

Get Started with IAP

If you have never worked with the Amazon Appstore SDK, or have never implemented the IAP API before, this page helps you set up your IDE and familiarize you with the recommended development, testing, and submission workflow for IAP.

This topic walks you through importing the IAP sample apps to your IDE, rather than starting a fresh project, so you can get started quicker. To learn the details on how to implement the IAP API, see Implementing IAP.

Download the Appstore SDK

You can download the Appstore SDK here:

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

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 set up your Android Studio development environment to work with the IAP sample apps:

  1. Extract the contents of the Appstore_SDK_<version>.zip file somewhere to your local machine.
  2. Start Android Studio.
  3. 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.
    2. On the Select Eclipse or Gradle Project to Import window, navigate to the location where you extracted the contents of the Amazon-Android-SDKs.zip file, then navigate to and select /Appstore_SDK_<version>/examples.
    3. Select the directory of one of the three IAP sample projects, and click OK to go to the Import Project from ADT screen.
    4. On the Import Project from ADT screen, select a destination directory, and click Next.
    5. On the screen that follows, leave all of the default settings checked, and click Finish to import the IAP sample app project.
    6. Repeat these steps for each sample app.
  4. If you are using the latest version of the Appstore SDK, you can skip this step. If you are using the legacy IAP v2.0 SDK, add the JAR file to your project:
    1. From the upper-left corner of Android Studio (just under the tab for your project), select Project from the drop-down menu (other choices are Android or Packages) to display a directory tree for your project.
    2. Under the app directory for your project, create a new directory and name it "libs".
    3. Copy the Appstore SDK JAR file to your new libs directory.

      If you are using a Mac, right-click the libs file, and select Reveal in Finder from the context menu. You will then be able to copy the Appstore SDK JAR file from Appstore_SDK_<version> to your new libs directory. When the directory refreshes, you will see the file in this directory in Android Studio.

    4. Right-click the Appstore SDK JAR file, and select Add as Library…

      The IAP library will be added to the list of gradle dependencies for your project. You should be able to successfully build the sample app project now.

      Note: If you would prefer to use gradle to add the library, open your build.gradle file and add the following code to the dependencies section of this file, then click the Sync Now link at the top of your build.gradle file to sync your changes:

      dependencies {
      ...
      compile fileTree(dir: 'libs', include: ['*.jar'])
      }
      
    5. Repeat these steps for each sample app project.
  5. Generate the APK for one of the sample apps:
    1. Connect your Android mobile device to your development computer.
    2. In Android Studio, click Debug, and select your running device to install the app to that device.

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

For Kotlin, clone or download the IAP Kotlin sample app from GitHub here:

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.

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.

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: Dec 06, 2023