当前位置: 首页>>代码示例>>Java>>正文


Java BillingProcessor.isIabServiceAvailable方法代码示例

本文整理汇总了Java中com.anjlab.android.iab.v3.BillingProcessor.isIabServiceAvailable方法的典型用法代码示例。如果您正苦于以下问题:Java BillingProcessor.isIabServiceAvailable方法的具体用法?Java BillingProcessor.isIabServiceAvailable怎么用?Java BillingProcessor.isIabServiceAvailable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.anjlab.android.iab.v3.BillingProcessor的用法示例。


在下文中一共展示了BillingProcessor.isIabServiceAvailable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkPayment

import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private void checkPayment(String productId) {
	boolean isAvailable = BillingProcessor.isIabServiceAvailable(mContext);
	if (isAvailable) {
		billingProcessor.purchase(mContext, productId);
	} else {
		Toast.makeText(mContext, R.string.ui_error, Toast.LENGTH_LONG).show();
	}
}
 
开发者ID:collaction,项目名称:content-farm-blocker-android,代码行数:9,代码来源:MainFragment.java

示例2: onResume

import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
@Override
protected void onResume() {
  super.onResume();
  if (Config.get().donationEnabled() && BillingProcessor.isIabServiceAvailable(this)) {
    bp = new BillingProcessor(this, Config.get().donationLicenseKey(), this);
  }
}
 
开发者ID:afollestad,项目名称:polar-dashboard,代码行数:8,代码来源:BaseDonateActivity.java

示例3: makePurchase

import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private void makePurchase(int product) {
    String sku = null;
    switch (product) {
        case 0:
            sku = SupporterHelper.SKU_TWO_DOLLAR;
            break;
        case 1:
            sku = SupporterHelper.SKU_SIX_DOLLAR;
            break;
        case 2:
            sku = SupporterHelper.SKU_TWELVE_DOLLAR;
            break;
        case 3:
            sku = SupporterHelper.SKU_THIRTY_DOLLAR;
            break;
    }

    //Get Product from SKU
    Products products = SupporterHelper.getProduct(sku);
    Analytics.from(this).sendAddToCartEvent(products, sku);

    //Initiate purchase
    if (BillingProcessor.isIabServiceAvailable(this)) {
        Analytics.from(this).sendStartCheckout(products);
        bp.purchase(this, sku);
    } else {
        SnackbarHandler.showErrorSnackbar(this, coordinatorLayout, "Issues connecting to Google Play Billing");
    }
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:30,代码来源:SupporterActivity.java

示例4: isIabServiceAvailable

import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
private Boolean isIabServiceAvailable() {
    return BillingProcessor.isIabServiceAvailable(_reactContext);
}
 
开发者ID:idehub,项目名称:react-native-billing,代码行数:4,代码来源:InAppBillingBridge.java

示例5: onCreate

import com.anjlab.android.iab.v3.BillingProcessor; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    int m_theme;
    final Context context = this;

    m_theme = R.style.BaseAppTheme;
    setTheme(m_theme);

    setContentView(R.layout.activity_support);
    ButterKnife.bind(this);

    if (SupporterHelper.isSupporter()) {
        purchaseButton.setText("You again? Sure!");
        enterReveal(supportThankYou);
    } else {
        purchaseButton.setText("Become a Supporter");
    }
    setSupportActionBar(toolbar);
    getSupportActionBar().setDisplayHomeAsUpEnabled(true);
    toolbar.setTitle("");

    isAvailable = BillingProcessor.isIabServiceAvailable(context);
    if (isAvailable) {
        // continue
        bp = new BillingProcessor(this, getResources().getString(R.string.rsa_key), this);
    } else {
        SnackbarHandler.showErrorSnackbar(this, coordinatorLayout, "Google Play billing services not available.");
    }

    nestedScrollView.setOnScrollChangeListener(new NestedScrollView.OnScrollChangeListener() {
        @Override
        public void onScrollChange(NestedScrollView v, int scrollX, int scrollY, int oldScrollX, int oldScrollY) {
            if (scrollY == (v.getChildAt(0).getMeasuredHeight() - v.getMeasuredHeight())) {
                fabSupporter.hide();
            } else {
                if (!fabSupporter.isShown()){
                    fabSupporter.show();
                }
            }
        }
    });
}
 
开发者ID:ItsCalebJones,项目名称:SpaceLaunchNow-Android,代码行数:44,代码来源:SupporterActivity.java


注:本文中的com.anjlab.android.iab.v3.BillingProcessor.isIabServiceAvailable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。