Game Development Reference
In-Depth Information
It may take a while for Admob Ads to appear on the screen as it is being set up for the very
first time, it should be faster in subsequent loads.
Selling In-App Features
Google Play offers the in-app billing service, which enables the developers to charge for
virtual items, additional features, or upgrades to unlock new levels in apps.
Google Play uses the same checkout backend service as is used for application purchases,
so your users experience a consistent and familiar purchase flow:
• To initiate a purchase, your app sends a billing request for a specific in-app
product.
• Google Play then handles all of the checkout details for the transaction, includ-
ing requesting and validating the form of payment and processing the financial
transaction.
• When the checkout process is complete, Google Play sends your app the pur-
chase details, such as the order number, the order date and time, and the price
paid.
To integrate in-app billing into your app, just follow the steps below:
Step 1: Adding the in-app billing library
To use the in-app billing version 3 features, you must add the IInAppBillingService.aidl
file to your Android project. This file defines the interface to the Google Play service.
You can find the file in the samples coming with the Google Play Services SDK. Copy it
into the /src directory of the project.
Build your app and you'll see a generated file named IInAppBillingService. java in the /gen
directory of your project.
Add the helper classes from the /util directory of the sample to your project. Remember to
change the package name declarations in those files accordingly so that your project com-
piles correctly.
Step 2: Setting up the manifest
Search WWH ::




Custom Search