article

Amelia@Amazon avatar image
Amelia@Amazon posted

Integrating Amazon Libraries with Android Studio

Summary

The following will help you integrate Amazon API Libraries with Android Studio.

IAP: Covered here: https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/getting-started-with-iap-v2.0#Setting Up Your Development Environment: Android Studio

Mobile Ads:

  1. Add the amazon ads jar to your libs directory for your Android Studio project, usually located at [Projectname]/app/libs
  2. Under File>Project Structure, click on the module for your app from the left hand list.
  3. Click on the dependencies tab
  4. Click on the green plus sign on the right of the window and select “File dependency”
  5. Navigate to the Amazon ads jar in the libs folder, and click okay
  6. Click Apply
  7. Amazon Ads should now be included as a library in your app
  8. Follow the instructions located at https://developer.amazon.com/public/apis/earn/mobile-ads/docs/quick-start#2. Update the Android Manifest to complete mobile ads integration

GameCircle:

  1. Download and unzip the Amazon Mobile App SDK: https://developer.amazon.com/public/resources/development-tools/sdk
  2. Either create a new project or open an existing android project in Android Studio
  3. Import the GameCircleSDK folder from the Mobile App SDK via File>”Import Module”
  4. Under File>”Project Structure”, navigate to your main application, then the dependencies tab.
  5. Under the dependencies tab, click the green plus sign on the right, then click “module dependency” and select the GameCircleSDK module that was imported earlier.
  6. In the AndroidManifest.xml for the GameCircleSDK module, change the package name under “package=”. The exact name does not matter, as long as it is not “com.amazon.ags”.
  7. In the AndroidManifest.xml for the main application, add the following: a. In the entry, add “xmlns:tools=http://schemas.android.com/tools” b. In the entry, add “tools:replace=”android:label””
  8. At this point, doing a normal build will work

Mobile Associates:

  1. Add the Drawable folder from the Mobile Associates sdk folder to your projects res/drawable folder
  2. Add the Mobile Associates jar to your libs directory for your Android Studio project, usually located at [Projectname]/app/libs
  3. Under File>Project Structure, click on the module for your app from the left hand list.
  4. Click on the dependencies tab
  5. Click on the green plus sign on the right of the window and select “File dependency”
  6. Navigate to the Amazon Mobile Associates jar in the libs folder, and click okay
  7. Click Apply 8. Amazon Mobile Associates should now be included as a library in your app

Amazon Device Messaging:

  1. Add the Amazon Device Messasing jar to your libs directory for your Android Studio project, usually located at [Projectname]/app/libs
  2. Under File>Project Structure, click on the module for your app from the left hand list.
  3. Click on the dependencies tab
  4. Click on the green plus sign on the right of the window and select “File dependency”
  5. Navigate to the Amazon Device Messaging jar in the libs folder, and click okay
  6. Click Apply
  7. Amazon Device Messaging should now be included as a library in your app

Amazon Maps:

See the Amazon Maps API Support Library for Android Studio Instructions https://developer.amazon.com/public/apis/experience/maps/docs-v2/configuring-your-project-to-use-the-amazon-maps-api-v2#Referencing

Keywords: Android Studio, Libraries, GameCircle, Amazon Device Messaging, Mobile Associates, Mobile Ads

KB_0002

androidlollipop
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Article

Contributors

wangchao contributed to this article brizzlebrazzle contributed to this article