本文整理汇总了Java中com.anjlab.android.iab.v3.BillingProcessor类的典型用法代码示例。如果您正苦于以下问题:Java BillingProcessor类的具体用法?Java BillingProcessor怎么用?Java BillingProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BillingProcessor类属于com.anjlab.android.iab.v3包,在下文中一共展示了BillingProcessor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
ButterKnife.bind(this);
bar.setTitle(R.string.donate);
bar.setNavigationIcon(R.drawable.md_nav_back);
bar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
findViewById(R.id.onedonate).setOnClickListener(this);
findViewById(R.id.twodonate).setOnClickListener(this);
findViewById(R.id.fivedonate).setOnClickListener(this);
findViewById(R.id.tendonate).setOnClickListener(this);
findViewById(R.id.fifteendonate).setOnClickListener(this);
bp = new BillingProcessor(this, Util.BILLING_KEY , this);
}
示例2: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
Toolbar toolbar = findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setTitle("Support development");
bp = new BillingProcessor(this, "", this);
mStatus = findViewById(R.id.donation_status);
productListView = findViewById(R.id.product_list);
progressBar = findViewById(R.id.progressBar);
}
示例3: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donation);
ButterKnife.bind(this);
setStatusbarColorAuto();
setNavigationbarColorAuto();
setTaskDescriptionColorAuto();
mToolbar.setBackgroundColor(ThemeStore.primaryColor(this));
setSupportActionBar(mToolbar);
//noinspection ConstantConditions
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
mToolbar.setNavigationOnClickListener(view -> onBackPressed());
mBillingProcessor
= new BillingProcessor(this, BuildConfig.GOOGLE_PLAY_LICENSE_KEY, this);
MDTintHelper.setTint(mProgressBar, ThemeStore.accentColor(this));
((TextView) findViewById(R.id.donation)).setTextColor(ThemeStore.accentColor(this));
}
示例4: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
ShowBackButton();
setContentView(R.layout.activity_donate);
bp = new BillingProcessor(DonateActivity.this, LICENSE_KEY, new BillingProcessor.IBillingHandler() {
@Override
public void onProductPurchased(String productId, TransactionDetails details) {
//DBHelper.ShowToastT(DonateActivity.this, "onProductPurchased: " + productId, Toast.LENGTH_LONG);
refreshPurchasesStatus();
}
@Override
public void onBillingError(int errorCode, Throwable error) {
// DBHelper.ShowToastT(DonateActivity.this, "onBillingError: " + Integer.toString(errorCode), Toast.LENGTH_LONG);
refreshPurchasesStatus();
}
@Override
public void onBillingInitialized() {
readyToPurchase = true;
DonatePriceTextLoadAsyncTask mt = new DonatePriceTextLoadAsyncTask();
mt.execute();
}
@Override
public void onPurchaseHistoryRestored() {
//DBHelper.ShowToastT(DonateActivity.this, "onPurchaseHistoryRestored", Toast.LENGTH_LONG);
refreshPurchasesStatus();
}
});
// ListView on Fragments
DonateListFragment fragment = new DonateListFragment();
getSupportFragmentManager().beginTransaction().replace(R.id.frgmCont, fragment).commit();
}
示例5: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getFragmentManager().beginTransaction().replace(android.R.id.content,
new SettingsFragment()).commit();
mBillingProcessor = new BillingProcessor(this, null, this);
mBillingProcessor.loadOwnedPurchasesFromGoogle();
}
示例6: onCreateDialog
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@NonNull
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
billingProcessor = new BillingProcessor(getContext(), App.GOOGLE_PLAY_LICENSE_KEY, this);
@SuppressLint("InflateParams")
View customView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_donation, null);
ProgressBar progressBar = ButterKnife.findById(customView, R.id.progress);
MDTintHelper.setTint(progressBar, ThemeSingleton.get().positiveColor.getDefaultColor());
return new MaterialDialog.Builder(getContext())
.title(R.string.support_development)
.customView(customView, false)
.build();
}
示例7: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String pKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk7CvCwFg6zjMPmczjAxaLlUjiriAudAOS1a+AFAC5KsA1ZeK7dW8g2spFW7ukmLaSAKQWqGgaKwrs+hntgbMsp2cPWe1x77z8gISdXUNZB2XuzjZqUTzRaGU3zoO9kjBAqQmSaZIo7hLb2hn70Yzeoo31fV4m1koHsNtzpMUksYpFwuD/HVJifHeO9E1bvea6ljidGtYz10hdoF/t+Lp77Exv/17pD9IbE8dKO/j0p/MFIAz0LF1+vyhg/bhpZs2X8Y3dWVv3fkthScj4Wemu8yDksTpCH6baDwjeZ5qe7eAoA3KnQsR7kssiUNXWWtUTUOON1GlOqcHVu9BJW52GwIDAQAB";
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(false);
bp = new BillingProcessor(this, pKey, this);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
@Override
public void onSignInFailed() {
}
@Override
public void onSignInSucceeded() {
}
};
gameHelper.setup(gameHelperListener);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new Hexpert(this, this, this), config);
}
示例8: getProcessor
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
public BillingProcessor getProcessor() {
if (mLicenseKey == null) {
LogUtil.e("InAppBillingProcessor: license key is null, make sure to call InAppBillingProcessor.init() first");
}
if (mInAppBilling.get().mBillingProcessor == null || !mInAppBilling.get().mIsInitialized) {
mInAppBilling.get().mBillingProcessor = new BillingProcessor(
mInAppBilling.get().mContext,
mLicenseKey,
mInAppBilling.get());
}
return mInAppBilling.get().mBillingProcessor;
}
示例9: 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();
}
}
示例10: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
if (DEBUG_ME) Log.d(TAG, "onCreate(savedInstanceState="
+ savedInstanceState + "): " + this);
setTheme(ThemeUtils.getPreferredTheme());
// If user has background disabled, apply the NoBackground overlay
if (!Prefs.getBoolean(R.string.pk_timer_bg_enabled,
DefaultPrefs.getBoolean(R.bool.default_backgroundEnabled))) {
getTheme().applyStyle(R.style.OverlayTheme_NoBackground, true);
}
LocaleUtils.onCreate();
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
bp = new BillingProcessor(this, null, this);
fragmentManager = getSupportFragmentManager();
if (savedInstanceState == null) {
fragmentManager
.beginTransaction()
.replace(R.id.main_activity_container, TimerFragmentMain.newInstance(), "fragment_main")
.commit();
}
handleDrawer(savedInstanceState);
}
示例11: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
setTheme(R.style.AppTheme);
super.onCreate(savedInstanceState);
prefs = PreferenceManager.getDefaultSharedPreferences(this);
if (prefs.getBoolean("hw_acceleration", true)) {
getWindow().setFlags(
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED,
WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED);
}
setContentView(R.layout.activity_about);
toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setNavigationIcon(R.drawable.ic_back_title_white);
toolbar.setNavigationOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
onBackPressed();
}
});
toolbar.setTitle("About");
toolbar.setTitleTextColor(ContextCompat.getColor(this, R.color.colorTextLight));
bp = new BillingProcessor(this, LICENSE_KEY, this);
coordinatorLayout = (CoordinatorLayout) findViewById(R.id.coordi_about);
donateContainer = (RelativeLayout) findViewById(R.id.donateContainer);
donateContainer.setVisibility(View.GONE);
rate = (TextView) findViewById(R.id.rate);
github = (TextView) findViewById(R.id.github);
donate = (TextView) findViewById(R.id.donate);
coke = (RelativeLayout) findViewById(R.id.layoutCoke);
brioches = (RelativeLayout) findViewById(R.id.layoutBrioches);
kebab = (RelativeLayout) findViewById(R.id.layoutKebab);
kingMeal = (RelativeLayout) findViewById(R.id.layoutKing);
present = (RelativeLayout) findViewById(R.id.layoutPresent);
computer = (RelativeLayout) findViewById(R.id.layoutPC);
setUpClick();
}
示例12: 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);
}
}
示例13: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mPager = (ViewPager) findViewById(R.id.pager);
mDonateButton = (TextView) findViewById(R.id.donate);
mPager.addOnPageChangeListener(this);
mDonateButton.setClickable(false);
mDonateButton.setOnClickListener(this);
mBillingProcessor = new BillingProcessor(this, Keys.GOOGLE_PLAY_RSA_PUBLIC, this);
}
示例14: 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");
}
}
示例15: onCreate
import com.anjlab.android.iab.v3.BillingProcessor; //导入依赖的package包/类
@Override protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_donate);
ButterKnife.bind(this);
setupToolbar();
// get instance of the BillingProcessor
mBillingProcessor = new BillingProcessor(this, BuildConfig.API_KEY_GOOGLE_PLAY, this);
// set up the buttons
if (!TextUtils.isEmpty(BuildConfig.API_KEY_GOOGLE_PLAY) && !TextUtils.equals("---", BuildConfig.API_KEY_GOOGLE_PLAY)) {
findViewById(R.id.card_donate_google_play).setVisibility(View.VISIBLE);
mGooglePlay.setText(getString(R.string.donate_via, getString(R.string.google_play)));
mGooglePlay.setOnClickListener(this);
// set up radio buttons
mRadioGroup.setOnCheckedChangeListener(this);
final String donateValue = getString(R.string.donate_value);
((RadioButton) findViewById(R.id.radioDonation1)).setText(String.format(donateValue, "2€"));
((RadioButton) findViewById(R.id.radioDonation2)).setText(String.format(donateValue, "5€"));
((RadioButton) findViewById(R.id.radioDonation3)).setText(String.format(donateValue, "10€"));
((RadioButton) findViewById(R.id.radioDonation4)).setText(String.format(donateValue, "20€"));
((RadioButton) findViewById(R.id.radioDonation5)).setText(String.format(donateValue, "50€"));
} else {
findViewById(R.id.card_donate_google_play).setVisibility(View.GONE);
}
final Button flattr = (Button) findViewById(R.id.bDonateFlattr);
flattr.setText(getString(R.string.donate_via, getString(R.string.flattr)));
flattr.setOnClickListener(this);
final TextView flattrText = (TextView) findViewById(R.id.tvDonateFlattr);
flattrText.setText(getString(R.string.donate_message, getString(R.string.flattr)));
final Button payPal = (Button) findViewById(R.id.bDonatePayPal);
payPal.setText(getString(R.string.donate_via, getString(R.string.paypal)));
payPal.setOnClickListener(this);
final TextView payPalText = (TextView) findViewById(R.id.tvDonatePayPal);
payPalText.setText(getString(R.string.donate_message, getString(R.string.paypal)));
}