Java Code Examples for com.android.billingclient.api.BillingClient#SkuType

The following examples show how to use com.android.billingclient.api.BillingClient#SkuType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BillingManager.java    From play-billing-codelab with Apache License 2.0 6 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
        final List<String> skuList, final SkuDetailsResponseListener listener) {
    // Specify a runnable to start when connection to Billing client is established
    Runnable executeOnConnectedService = new Runnable() {
        @Override
        public void run() {
            SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder()
                    .setSkusList(skuList).setType(itemType).build();
            mBillingClient.querySkuDetailsAsync(skuDetailsParams,
                    new SkuDetailsResponseListener() {
                        @Override
                        public void onSkuDetailsResponse(int responseCode,
                                List<SkuDetails> skuDetailsList) {
                            listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                        }
                    });
        }
    };

    // If Billing client was disconnected, we retry 1 time and if success, execute the query
    startServiceConnectionIfNeeded(executeOnConnectedService);
}
 
Example 2
Source File: BillingManager.java    From PhoneProfilesPlus with Apache License 2.0 6 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
                                 final List<String> skuList, final SkuDetailsResponseListener listener) {
    // Specify a runnable to start when connection to Billing client is established
    Runnable executeOnConnectedService = new Runnable() {
        @Override
        public void run() {
            SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder()
                    .setSkusList(skuList).setType(itemType).build();
            mBillingClient.querySkuDetailsAsync(skuDetailsParams,
                    new SkuDetailsResponseListener() {
                        @Override
                        public void onSkuDetailsResponse(@NonNull BillingResult billingResult, List<SkuDetails> skuDetailsList) {
                            listener.onSkuDetailsResponse(billingResult, skuDetailsList);
                        }
                    });
        }
    };

    // If Billing client was disconnected, we retry 1 time and if success, execute the query
    startServiceConnectionIfNeeded(executeOnConnectedService);
}
 
Example 3
Source File: BillingManager.java    From SchoolQuest with GNU General Public License v3.0 5 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
                                 final List<String> skuList,
                                 final SkuDetailsResponseListener listener) {
    SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder().setSkusList(skuList).
            setType(itemType).build();
    mBillingClient.querySkuDetailsAsync(skuDetailsParams, new SkuDetailsResponseListener() {
        @Override
        public void onSkuDetailsResponse(int responseCode, List<SkuDetails> skuDetailsList) {
            listener.onSkuDetailsResponse(responseCode, skuDetailsList);
        }
    });
}
 
Example 4
Source File: BillingManager.java    From play-billing-codelab with Apache License 2.0 5 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
        final List<String> skuList, final SkuDetailsResponseListener listener) {
    SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder()
            .setSkusList(skuList).setType(itemType).build();
    mBillingClient.querySkuDetailsAsync(skuDetailsParams,
            new SkuDetailsResponseListener() {
                @Override
                public void onSkuDetailsResponse(int responseCode,
                                                 List<SkuDetails> skuDetailsList) {
                    listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                }
            });
}
 
Example 5
Source File: BillingManager.java    From play-billing-codelab with Apache License 2.0 5 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
        final List<String> skuList, final SkuDetailsResponseListener listener) {
    SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder().setSkusList(skuList)
            .setType(itemType).build();
    mBillingClient.querySkuDetailsAsync(skuDetailsParams,
            new SkuDetailsResponseListener() {
                @Override
                public void onSkuDetailsResponse(int responseCode, List<SkuDetails> skuDetailsList) {
                    listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                }
            });
}
 
Example 6
Source File: BillingManager.java    From play-billing-codelab with Apache License 2.0 5 votes vote down vote up
public void querySkuDetailsAsync(@BillingClient.SkuType final String itemType,
                                 final List<String> skuList, final SkuDetailsResponseListener listener) {
    SkuDetailsParams skuDetailsParams = SkuDetailsParams.newBuilder()
            .setSkusList(skuList).setType(itemType).build();
    mBillingClient.querySkuDetailsAsync(skuDetailsParams,
            new SkuDetailsResponseListener() {
                @Override
                public void onSkuDetailsResponse(int responseCode,
                                                 List<SkuDetails> skuDetailsList) {
                    listener.onSkuDetailsResponse(responseCode, skuDetailsList);
                }
            });
}
 
Example 7
Source File: BillingManager.java    From PhoneProfilesPlus with Apache License 2.0 4 votes vote down vote up
public List<String> getSkus(/*boolean release, */@BillingClient.SkuType String type) {
    //if (release)
        return SKUS.get(type);
    //else
    //    return SKUS_DEBUG.get(type);
}