Save the date! Android Dev Summit is coming to Mountain View, CA on November 7-8, 2018.

BillingHelper

public final class BillingHelper
extends Object

java.lang.Object
   ↳ com.android.billingclient.util.BillingHelper


Helper methods for billing client.

Summary

Constants

String INAPP_CONTINUATION_TOKEN

String RESPONSE_BUY_INTENT

String RESPONSE_CODE

String RESPONSE_GET_SKU_DETAILS_LIST

String RESPONSE_INAPP_ITEM_LIST

String RESPONSE_INAPP_PURCHASE_DATA_LIST

String RESPONSE_INAPP_SIGNATURE_LIST

Fields

public static int NUMBER_OF_CORES

Total number of cores of current device

Public constructors

BillingHelper()

Public methods

static List<Purchase> extractPurchases(Bundle bundle)

Gets a purchase data and signature (or lists of them) from the Bundle and returns the constructed list of Purchase

static int getResponseCodeFromBundle(Bundle bundle, String tag)

Retrieves a response code from the bundle

static int getResponseCodeFromIntent(Intent intent, String tag)

Retrieves a response code from the intent

static void logVerbose(String tag, String msg)

Logs a verbose message

static void logWarn(String tag, String msg)

Logs a warning message

Inherited methods

From class java.lang.Object

Constants

INAPP_CONTINUATION_TOKEN

String INAPP_CONTINUATION_TOKEN

Constant Value: "INAPP_CONTINUATION_TOKEN"

RESPONSE_BUY_INTENT

String RESPONSE_BUY_INTENT

Constant Value: "BUY_INTENT"

RESPONSE_CODE

String RESPONSE_CODE

Constant Value: "RESPONSE_CODE"

RESPONSE_GET_SKU_DETAILS_LIST

String RESPONSE_GET_SKU_DETAILS_LIST

Constant Value: "DETAILS_LIST"

RESPONSE_INAPP_ITEM_LIST

String RESPONSE_INAPP_ITEM_LIST

Constant Value: "INAPP_PURCHASE_ITEM_LIST"

RESPONSE_INAPP_PURCHASE_DATA_LIST

String RESPONSE_INAPP_PURCHASE_DATA_LIST

Constant Value: "INAPP_PURCHASE_DATA_LIST"

RESPONSE_INAPP_SIGNATURE_LIST

String RESPONSE_INAPP_SIGNATURE_LIST

Constant Value: "INAPP_DATA_SIGNATURE_LIST"

Fields

NUMBER_OF_CORES

int NUMBER_OF_CORES

Total number of cores of current device

Public constructors

BillingHelper

BillingHelper ()

Public methods

extractPurchases

List<Purchase> extractPurchases (Bundle bundle)

Gets a purchase data and signature (or lists of them) from the Bundle and returns the constructed list of Purchase

Parameters
bundle Bundle: The bundle to parse

Returns
List<Purchase> New Purchase instance with the data extracted from the provided intent

getResponseCodeFromBundle

int getResponseCodeFromBundle (Bundle bundle, 
                String tag)

Retrieves a response code from the bundle

Parameters
bundle Bundle

tag String

Returns
int

getResponseCodeFromIntent

int getResponseCodeFromIntent (Intent intent, 
                String tag)

Retrieves a response code from the intent

Parameters
intent Intent

tag String

Returns
int

logVerbose

void logVerbose (String tag, 
                String msg)

Logs a verbose message

Parameters
tag String: Tag to be used inside logging

msg String: Message to log

logWarn

void logWarn (String tag, 
                String msg)

Logs a warning message

Parameters
tag String: Tag to be used inside logging

msg String: Message to log