이름 |
설명 |
BillingReceiver |
|
BillingService |
|
BillingService.BillingRequest |
The base class for all requests that use the MarketBillingService. Each derived class overrides the run() method to call the appropriate service interface. If we are already connected to the MarketBillingService, then we call the run() method directly. Otherwise, we bind to the service and save the request on a queue to be run later when the service is connected. |
BillingService.CheckBillingSupported |
Wrapper class that checks if in-app billing is supported. Note: Support for subscriptions implies support for one-time purchases. However, the opposite is not true. Developers may want to perform two checks if both one-time and subscription products are available. |
BillingService.ConfirmNotifications |
Wrapper class that confirms a list of notifications to the server. |
BillingService.GetPurchaseInformation |
Wrapper class that sends a GET_PURCHASE_INFORMATION message to the server. |
BillingService.RequestPurchase |
Wrapper class that requests a purchase. |
BillingService.RestoreTransactions |
Wrapper class that sends a RESTORE_TRANSACTIONS message to the server. |
Consts |
This class holds global constants that are used throughout the application to support in-app billing. |
OrderBilled |
|
PurchaseDatabase |
An example database that records the state of each purchase. You should use an obfuscator before storing any information to persistent storage. The obfuscator should use a key that is specific to the device and/or user. Otherwise an attacker could copy a database full of valid purchases and distribute it to others. |
PurchaseDatabase.DatabaseHelper |
This is a standard helper class for constructing the database. |
PurchaseObserver |
An interface for observing changes related to purchases. The main application extends this class and registers an instance of that derived class with ResponseHandler. The main application implements the callbacks #onBillingSupported(boolean) and #onPurchaseStateChange(PurchaseState, String, int, long). These methods are used to update the UI. |
ResponseHandler |
This class contains the methods that handle responses from Android Market. The implementation of these methods is specific to a particular application. The methods in this example update the database and, if the main application has registered a {@llink PurchaseObserver}, will also update the UI. An application might also want to forward some responses on to its own server, and that could be done here (in a background thread) but this example does not do that. You should modify and obfuscate this code before using it. |
Security |
Security-related methods. For a secure implementation, all of this code should be implemented on a server that communicates with the application on the device. For the sake of simplicity and clarity of this example, this code is included here and is executed on the device. If you must verify the purchases on the phone, you should obfuscate this code to make it harder for an attacker to replace the code with stubs that treat all purchases as verified. |
Security.VerifiedPurchase |
A class to hold the verified purchase information. |