Amazon Kindle In App

This is for Amazon Kindle(Android) In App Purchase implementation

How to install In App SDK(Mobile SDK)

There are two ways to install In App SDK for Amazon Kindle

  • Eclipse plugin
  • Download SDK from Amazon Web Site

Eclipse plugin

Add Available Software URL https://developer.amazon.com/sdk.html
You can select Amazon Mobile App SDK

Eclipse Amazon API

You can manage jars(add path by auto)

Download SDK

Please access AmazonMobile App SDK
There are a lot of jars and documentation and samples in SDK.
In App SDK is in-app-purchasing-x.jar. You just copy this to /libs


Test Phase

How to test Amazon In App purchase

Test Sandbox

We can do Sandbox test before registering developer account
Steps

  1. Install Amazon SDK Tester in your kindle Device
  2. Prepare item list as json file
  3. Implement Amazon In App observer
  4. Prepare Receipt Verification Server
Install Amazon SDK Tester in your kindle Device

Amazon prepares in app management tool for testing in App purchase.
This application hooks Amazon Android Application and plays a role of Amazon In App Server(seems to be strange…)

Prepare item list as json file

Prepare item json file( Samples are under SDK amazon.sdktester.json)
Please copy this file into kindle device.(Copy dst is Android top)

Amazon SDK Tester reads this file and create item list

{
  "com.amazon.sample.iap.consumable.orange" : {
    "itemType": "CONSUMABLE",
    "price": 10.00,
    "title": "Orange",
    "description": "An orange"
  }
}
Implement Amazon In App observer

Samples are under SDK named SampleIAPConsumablesApp.
The key part is AppPurchasingObserver.java

Prepare Receipt Verification Server

Observer returns Amazon In App Receipt.
You should verify this receipt to send to verification server.
In real app, Amazon prepares verification server.
For testing, you need to prepare your own server.
Amazon prepares Java Server application for it(RVSSandbox.war).
You can prepare Tomcat or other AP server and server for it and can test it.

What is receipt? It’s just json

Real

You need to register amazon developer account

Tips

Restore is required? : Not needed, but should be prepared for users
Google Play Account? : No kindle need Amazon User Account, not Google Play
Works with Single Binary both Google Play and Amazon? : Yes, but be careful

Ref