SLIDE 1
In-App Purchases for an Android Game
Bill Lahti Tridroid Meeting August 7, 2014
SLIDE 2 Bill is a software engineer who builds mobile applications and knowledge management solutions. Bill works at Duke Corporate Education. Outside of work, his main interests are writing Android tutorials for his blog and building Android apps. blahti.wordpress.com - Android tutorials wglxy.com Android Apps
- Gomoku League https://play.google.com/store/apps/details?
id=com.wglxy.gomoku.a
http://www.wglxy.com/double-star-beta
Bill Lahti
SLIDE 3
- In-App Purchases example
- Different revenue models for apps
- In-App Billing for Android
- What you should consider for in-app purchases
- How in-app purchases are handled in other apps
(Angry Birds, Temple Run, Candy Crush Saga)
- In-app purchases in Double Star
- How many in-app items should you have?
- How do you call the player's attention to them?
- Pricing considerations
- How to implement In-App Billing
○ TrivialDrive example app ○ Adapting example to your own app
Overview
SLIDE 4 Trivial Drive demo app from Google Developers App: Drive your car. When you run out of gas, purchase gas. Design Considerations
- UI elements
- Invitation to purchase
Example of In-App Purchases
SLIDE 5
Trivial Drive
SLIDE 6
Trivial Drive
SLIDE 7
Different revenue models Monetizing Android Apps - Google IO 2012 https://www.youtube.com/watch?v=DJdx_Wd_EOo Making Money on Google Play - Google IO 2013 https://plus.google.com/u/0/communities/113741436953313178716 I have been working on a “freemium” model. Free app with in-app purchases.
In-App Purchases and Other Revenue Models
SLIDE 8
https://www.youtube.com/watch?v=DJdx_Wd_EOo
Monetizing Android Apps
SLIDE 9
https://plus.google.com/u/0/communities/113741436953313178716
In-App Purchases are doing well
SLIDE 10
Trivial Drive demo app from Google Developers How does it work? How do you implement in- app billing?
A Sample App: Trivial Drive
SLIDE 11 In-app billing code is not too difficult. Definitely start with a working app. Learn:
- How to define products for sale.
- Learn how to make them available for sale in your app.
- Learn how to make a transaction.
Things you need to know:
- How to package app as apk
- How to “sign” your app
- How to release your app on Google Developers Console.
- How to do Alpha / Beta release
- How to do a test purchase
- How to set up Google Wallet Merchant
Trivial Drive Sample
SLIDE 12 Reference: http://blahti.wordpress.com/2014/07/30/how-to-add-in-app-billing-in-android-part-1/
Trivial Drive Tutorial
My blog: blahti. wordpress.com Step-by-step walkthrough of their example. My article highlights key points and makes a few corrections.
SLIDE 13
We won’t go through the tutorial here. Read the blog article. A few points: Developer console Defining an app Packaging your app Inside the code Application key Releasing your app - Alpha Testing your app Study the code
Tutorial Summary
SLIDE 14
Getting the list of items for sale Seeing what items have already been purchased Starting and completing transactions to purchase an item interface IInAppBillingService util package
Study the Code
SLIDE 15 public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // load game data loadData(); String base64EncodedPublicKey = “REAL KEY GOES HERE”; ...
SLIDE 16 mHelper = new IabHelper(this, base64EncodedPublicKey); mHelper.startSetup(new IabHelper.OnIabSetupFinishedListener() { public void onIabSetupFinished(IabResult result) { // IAB is fully set up. Now, let's get an inventory of stuff we own. mHelper.queryInventoryAsync(mGotInventoryListener); } });
SLIDE 17 // Listener that's called after querying the items and subscriptions we own IabHelper.QueryInventoryFinishedListener mGotInventoryListener = new IabHelper.QueryInventoryFinishedListener() { public void onQueryInventoryFinished(IabResult result, Inventory inventory) { // Check for items we own. Notice that for each purchase, we check // Do we have the premium upgrade? Purchase premiumPurchase = inventory.getPurchase (SKU_PREMIUM); mIsPremium = (premiumPurchase != null && verifyDeveloperPayload (premiumPurchase)); ... updateUi(); setWaitScreen(false); }
- nCreate of MainActivity (continued)
SLIDE 18 public void onBuyGasButtonClicked(View arg0) { // launch the gas purchase UI flow. // We will be notified of completion via mPurchaseFinishedListener setWaitScreen(true); mHelper.launchPurchaseFlow(this, SKU_GAS, RC_REQUEST, mPurchaseFinishedListener, payload); }
SLIDE 19
See section in blog article. Use test accounts first. Then release Alpha version. Test with regular accounts. Refund test orders in your Google Wallet Merchant account.
Testing Trivial Drive
SLIDE 20 Think about your app design
- What is your game / app?
- Are in-app purchases right for it?
- How would you implement in-app purchases?
- How is your app structured?
What do you do after Trivial Drive?
SLIDE 21
- What you should consider for in-app purchases
- How in-app purchases are handled in other apps
(Angry Birds, Temple Run, Candy Crush Saga)
- In-app purchases in Double Star
- How many in-app items should you have?
- How do you call the player's attention to them?
- Pricing considerations
Design Considerations
SLIDE 22
Temple Run 2 Angry Birds Candy Crush Saga
Study Other Apps
SLIDE 23
Temple Run 2
SLIDE 24
Screens - flow Screens - detail
Angry Birds
SLIDE 25
Angry Birds game flow
Splash Games - 10+ settings / games Levels screens Storyline / Plot (one time) Tutorial - how to use slingshot (one time) Play Success (level cleared) Continue - next game, or back to levels Some points about Angry Birds: Big deal for success (lively, animated) Buttons for powerups are on Play screen, but only obvious after you press a button.
SLIDE 26
Angry Birds - Splash
SLIDE 27
Angry Birds game selection
SLIDE 28
Angry Birds Levels
SLIDE 29
Angry Birds Storyline
SLIDE 30
Angry Birds Play
SLIDE 31
Angry Birds Level Cleared
SLIDE 32
Screens - flow Screens - detail
Candy Crush Saga
SLIDE 33 Candy Crush Saga Flow
Splash
Levels - depiction of your journey High Score - Level objectives To encourage Leaderboards To focus on goals To invite you to upgrade Instruction screen - with Skip button Play Status and score clearly displayed High Score - Level Objectives To remind about Leaderboards Levels Animation of progress Play new level or repeat an old
SLIDE 34
Candy Crush Saga - Splash
SLIDE 35
Candy Crush Saga - Levels
SLIDE 36
Candy Crush Saga - High Score / Levels
SLIDE 37
Candy Crush Saga - Instruction Screen
SLIDE 38
Candy Crush Saga - Play
SLIDE 39
Candy Crush Saga - High Score / Objectives
SLIDE 40
Temple Run 2
SLIDE 41
If you have enough gold coins, you can purchase extra equipment or improve your fighting capability.
My App: Double Star
SLIDE 42
In-app purchases, as an alternative to earning coins.
My App: Double Star
SLIDE 43
… Still working on how to encourage players to upgrade. My plan is to use Candy Crush as the model. References: In-App Billing in a Space War Game
Double Star - in-app upgrades
SLIDE 44 Beta Test
- Distribute your app through Google Play
- Only your testers see the app and are allowed to install.
- When you go to production, ratings from Beta are gone.
Installation You have to join a community. Join the Beta community on Google+. Click “Install app”. Then click “Become a tester” and “Download app”. Try it now: A link for your convenience is on my blog: blahti.wordpress.com
Try Double Star
SLIDE 45
Double Star Beta Community
Join the Beta community on Google+. Then click “Install app”. Then click “Become a tester” and “Download app”. https://plus.google.com/u/0/communities/113741436953313178716
SLIDE 46 How I adapted Trivial Drive code … will be in Part 2 of my blog article.
- Understanding the code and methods that you use to
make in-app purchases.
- Adding in-app billing code in a way that does not
complicate your existing app code.
- Making it easy to track changes to the in-app billing
code.
- Making design decisions about what in-app products to
- ffer and how to present them to users.
- Information about the best practices the README
authors mention related to security.
In-App Implementation in Double Star
SLIDE 47
In-App Purchases for an Android Game
Bill Lahti Tridroid Meeting August 7, 2014 For Android tutorials and sample programs, visit blahti.wordpress.com