In-App Purchases for an Android Game Bill Lahti Tridroid Meeting August 7, 2014
Bill Lahti 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 ● Double Star http://www.wglxy.com/double-star-beta
Overview ● 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
Example of In-App Purchases 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
Trivial Drive
Trivial Drive
In-App Purchases and Other Revenue Models 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.
Monetizing Android Apps https://www.youtube.com/watch?v=DJdx_Wd_EOo
In-App Purchases are doing well https://plus.google.com/u/0/communities/113741436953313178716
A Sample App: Trivial Drive Trivial Drive demo app from Google Developers How does it work? How do you implement in- app billing?
Trivial Drive Sample 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 Tutorial My blog: blahti. wordpress.com Step-by-step walkthrough of their example. My article highlights key points and makes a few corrections. Reference: http://blahti.wordpress.com/2014/07/30/how-to-add-in-app-billing-in-android-part-1/
Tutorial Summary 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
Study the Code 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
onCreate of MainActivity public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // load game data loadData(); String base64EncodedPublicKey = “REAL KEY GOES HERE”; ...
onCreate of MainActivity 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); } });
onCreate of MainActivity (continued) // 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); }
onBuyGasButtonClicked 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); }
Testing Trivial Drive 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.
What do you do after Trivial Drive? 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?
Design Considerations ● 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
Study Other Apps Temple Run 2 Angry Birds Candy Crush Saga
Temple Run 2
Angry Birds Screens - flow Screens - detail
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.
Angry Birds - Splash
Angry Birds game selection
Angry Birds Levels
Angry Birds Storyline
Angry Birds Play
Angry Birds Level Cleared
Candy Crush Saga Screens - flow Screens - detail
Candy Crush Saga Flow S plash 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 one
Candy Crush Saga - Splash
Candy Crush Saga - Levels
Candy Crush Saga - High Score / Levels
Candy Crush Saga - Instruction Screen
Candy Crush Saga - Play
Candy Crush Saga - High Score / Objectives
Temple Run 2
My App: Double Star If you have enough gold coins, you can purchase extra equipment or improve your fighting capability.
My App: Double Star In-app purchases, as an alternative to earning coins.
Double Star - in-app upgrades … 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
Try Double Star 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
Double Star Beta Community https://plus.google.com/u/0/communities/113741436953313178716 Join the Beta community on Google+. Then click “Install app”. Then click “Become a tester” and “Download app”.
In-App Implementation in Double Star 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 offer and how to present them to users. ● Information about the best practices the README authors mention related to security.
In-App Purchases for an Android Game Bill Lahti Tridroid Meeting August 7, 2014 For Android tutorials and sample programs, visit blahti.wordpress.com
Recommend
More recommend