MBL205 Monetizing Your App on Kindle Fire - AWS re: Invent 2012

874 views

Published on

The Amazon In-App Purchasing API makes it easy for you to offer digital content and subscriptions —such as in-game currency, expansion packs, upgrades, magazine issues and more— for purchase within your apps. Within minutes you can be up and running, ready to give millions of Amazon customers the ability to purchase engaging digital content using their Amazon 1-Click settings. Discover how in-app purchasing can help you monetize your apps on Kindle Fire and learn how to integrate the Amazon In-App Purchasing API into your mobile apps.

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
874
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

MBL205 Monetizing Your App on Kindle Fire - AWS re: Invent 2012

  1. 1. digital currency, character upgradesfree-to-paid upgradesperiodicals, subscription gamesexpansion packs, custom content
  2. 2. developer.amazon.com/sdk.html
  3. 3. developer.amazon.com/sdk.html
  4. 4. developer.amazon.com/sdk.html
  5. 5. developer.amazon.com/sdk.html
  6. 6. Amazon Appstore In-App SDKPurchasing Manager Purchasing Observer
  7. 7. Amazon Appstore In-App SDK Purchasing Manager Purchasing ObserverSends messages to the In-App SDK
  8. 8. Amazon Appstore In-App SDK Purchasing Manager Purchasing ObserverReceives messages from the In-App SDK
  9. 9. developer.amazon.com/sdk.html
  10. 10. canare not is not
  11. 11. can notare is not
  12. 12. can notare is
  13. 13. strings.xml<?xml version="1.0" encoding="utf-8"?><resources><string name="consumable_sku">com.amazon.buttonclicker.ten_clicks</string></resources>
  14. 14. strings.xml<?xml version="1.0" encoding="utf-8"?><resources><string name="consumable_sku">com.amazon.buttonclicker.ten_clicks</string></resources>
  15. 15. AndroidManifest.xml...<receiver android:name=“com.amazon.inapp.purchasing.ResponseReceiver”> <intent-filter> <action android:name=“com.amazon.inapp.purchasing.NOTIFY” android:permission=“com.amazon.inapp.purchasing.Permission.NOTIFY” /> </intent-filter><receiver>...
  16. 16. Create a PurchasingObserver
  17. 17. ButtonClickerObserver.javaprivate class ButtonClickerObserver {}
  18. 18. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver {}
  19. 19. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() { }}
  20. 20. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver( final ButtonClickerActivity buttonClickerActivity) { }}
  21. 21. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver( final ButtonClickerActivity buttonClickerActivity) { super(ButtonClickerActivity); }}
  22. 22. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver( final ButtonClickerActivity buttonClickerActivity) { super(ButtonClickerActivity); this.baseActivity = buttonClickerActivity; }}
  23. 23. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver( final ButtonClickerActivity buttonClickerActivity) { super(ButtonClickerActivity); this.baseActivity = buttonClickerActivity; }}
  24. 24. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space}
  25. 25. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) { }}
  26. 26. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) { super.onSdkAvailable(isSandboxMode); Log.i(TAG, "Sdk is available!"); }}
  27. 27. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) { super.onSdkAvailable(isSandboxMode); Log.i(TAG, "Sdk is available!"); }}
  28. 28. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..}}
  29. 29. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { }}
  30. 30. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { Log.i(TAG, “Purchase Status = “ + purchaseResponse.getPurchaseStatus()); }}
  31. 31. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { Log.i(TAG, “Purchase Status = “ + purchaseResponse.getPurchaseStatus()); }}
  32. 32. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) {..}}
  33. 33. Register the PurchasingObserver with thePurchasingManager
  34. 34. ButtonClickerActivity.java@Overrideprotected void onStart(){ super.onStart();}
  35. 35. ButtonClickerActivity.java@Overrideprotected void onStart(){ super.onStart(); ButtonClickerObserver buttonClickerObserver = new ButtonClickerObserver(this);}
  36. 36. ButtonClickerActivity.java@Overrideprotected void onStart(){ super.onStart(); ButtonClickerObserver buttonClickerObserver = new ButtonClickerObserver(this); PurchasingManager.registerObserver(buttonClickerObserver);}
  37. 37. Make sure IAP is available
  38. 38. Make sure IAP is available Let’s just pretend it always is!
  39. 39. Make sure IAP is available Let’s just pretend it always is!
  40. 40. Make sure IAP is availableSend a purchase request
  41. 41. ButtonClickerActivity.java/** Called when our ‘purchase hint’ button is clicked*/public void onBuyMoreClicks(View view) {}
  42. 42. ButtonClickerActivity.java/** Called when our ‘purchase hint’ button is clicked*/public void onBuyMoreClicks(View view) { PurchasingManager.initiatePurchase(MY_SKU);}
  43. 43. ButtonClickerActivity.java/** Called when our ‘purchase hint’ button is clicked*/public void onBuyMoreClicks(View view) { PurchasingManager.initiatePurchase(MY_SKU);}
  44. 44. Make sure IAP is availableSend a purchase request
  45. 45. Make sure IAP is availableSend a purchase requestHandle the response
  46. 46. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) {..}}
  47. 47. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { Log.i(TAG, “Purchase Status = “ + purchaseResponse.getPurchaseStatus()); }}
  48. 48. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { Log.i(TAG, “Purchase Status = “ + purchaseResponse.getPurchaseStatus()); if(purchaseResponse.getPurchaseRequestStatus() == PurchaseResponse.SUCCESSFUL){ this.setNumClicks(this.getNumClicks() + 1); } }}
  49. 49. ButtonClickerObserver.javaprivate class ButtonClickerObserver extends BasePurchasingObserver { public ButtonClickerObserver() {..} //code folding to save space @Override public void onSdkAvailable(boolean isSandboxMode) {..} @Override public void onPurchaseResponse( PurchaseResponse purchaseResponse) { Log.i(TAG, “Purchase Status = “ + purchaseResponse.getPurchaseStatus()); if(purchaseResponse.getPurchaseRequestStatus() == PurchaseResponse.SUCCESSFUL){ this.setNumClicks(this.getNumClicks() + 1); } }}
  50. 50. developer.amazon.com/sdk.html
  51. 51. We are sincerely eager to hear your feedback on thispresentation and on re:Invent. Please fill out an evaluation form when you have a chance.

×