资源简介
Google Play结算库V2.0.3版本 接入实例,主要实现了接入流程,及支付流程,及调用支付的封装
修复developerPayload重复传值的问题
修复developerPayload重复传值的问题
代码片段和文件信息
package com.thinkfly.gp;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import com.android.billing.BillingManager;
import com.android.billing.LoggerUtil;
import com.android.billingclient.api.BillingClient;
import com.android.billingclient.api.BillingResult;
import com.android.billingclient.api.Purchase;
import com.android.billingclient.api.SkuDetails;
import com.android.billingclient.api.SkuDetailsResponseListener;
import org.json.JSONException;
import java.util.ArrayList;
import java.util.List;
public class MainActivity extends Activity {
private static LoggerUtil loggerUtil;
public static final String TAG = MainActivity.class.getSimpleName();
static {
loggerUtil = new LoggerUtil();
loggerUtil.setTag(TAG);
}
public static final String SKU_ID = “com.sdk.new.1“;
private BillingManager mBillingManager;
private List mSkuDetails = new ArrayList<>();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mBillingManager = new BillingManager(this new BillingManager.BillingUpdatesListener() {
@Override
public void onBillingClientSetupFinished() {
List skuList = new ArrayList<>();
skuList.add(SKU_ID);
handleManagerAndUiReady(BillingClient.SkuType.INAPP skuList);
}
@Override
public void onConsumeFinished(BillingResult billingResult String purchaseToken) {
loggerUtil.printDebugLog(“Consumption finished. Purchase token: %s result: %s“ purchaseToken billingResult.getResponseCode());
if (billingResult.getResponseCode() == BillingClient.BillingResponseCode.OK) {
// Successfully consumed so we apply the effects of the item in our
// game world‘s logic which in our case means filling the gas tank a bit
loggerUtil.printDebugLog(“Consumption successful. Provisioning.“);
} else {
loggerUtil.printDebugLog(“Error while consuming: %1$s“ billingResult.getResponseCode());
}
loggerUtil.printDebugLog(“End consumption flow.“);
}
@Override
public void onPurchasesUpdated(List purchases) {
for (Purchase purchase : purchases) {
if (purchase.getPurchaseState() == Purchase.PurchaseState.PURCHASED) {
// Acknowledge purchase and grant the item to the user
} else if (purchase.getPurchaseState() == Purchase.PurchaseState.PENDING) {
// Here you can confirm to the user that they‘ve started the pending
/
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-10-16 18:38 GooglePay\
文件 216 2019-10-15 15:00 GooglePay\.gitignore
目录 0 2019-10-16 18:39 GooglePay\app\
文件 8 2019-10-15 15:00 GooglePay\app\.gitignore
文件 614 2019-10-16 18:39 GooglePay\app\build.gradle
目录 0 2019-10-15 15:00 GooglePay\app\libs\
文件 772 2019-10-15 15:00 GooglePay\app\proguard-rules.pro
目录 0 2019-10-16 18:38 GooglePay\app\src\
目录 0 2019-10-16 18:38 GooglePay\app\src\androidTest\
目录 0 2019-10-15 15:03 GooglePay\app\src\androidTest\java\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\
文件 688 2019-10-16 10:04 GooglePay\app\src\main\AndroidManifest.xm
目录 0 2019-10-16 18:38 GooglePay\app\src\main\java\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\java\com\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\java\com\thinkfly\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\java\com\thinkfly\gp\
文件 5788 2019-10-16 17:58 GooglePay\app\src\main\java\com\thinkfly\gp\MainActivity.java
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\drawable\
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\drawable-v24\
文件 1914 2019-10-15 15:02 GooglePay\app\src\main\res\drawable-v24\ic_launcher_foreground.xm
文件 5776 2019-10-15 15:02 GooglePay\app\src\main\res\drawable\ic_launcher_background.xm
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\layout\
文件 514 2019-10-16 09:52 GooglePay\app\src\main\res\layout\activity_main.xm
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\mipmap-anydpi-v26\
文件 276 2019-10-15 15:02 GooglePay\app\src\main\res\mipmap-anydpi-v26\ic_launcher.xm
文件 276 2019-10-15 15:02 GooglePay\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xm
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\mipmap-hdpi\
文件 2963 2019-10-15 15:00 GooglePay\app\src\main\res\mipmap-hdpi\ic_launcher.png
文件 4905 2019-10-15 15:00 GooglePay\app\src\main\res\mipmap-hdpi\ic_launcher_round.png
目录 0 2019-10-16 18:38 GooglePay\app\src\main\res\mipmap-mdpi\
............此处省略50个文件信息
- 上一篇:接触网欧标设计 EN50119-2009
- 下一篇:建筑物的地面扫描点云数据
相关资源
- Google Earth 中国国界轮廓.kml
- Payload_Dumber_x64.7z
- 易宝支付接口参数文档
- payload.bin解包
- GoogleEarth高程数据采集工具V1.1.0.1(和
- Google PPT模板
- 中国各省、直辖市、自治区界线,k
- google_usb_driver
- Google book Downloader 谷歌电子书PDF工具
- google earth api
- SGGS-Google earth拼图工具
- ADA_CDMATool_V2-网优插件
- Google Map api V3 (3.9.12)的离线开发包
- 浪潮之巅 清晰pdf版
- 这就是OKR,中文版,非扫描
- 百度_Google_Sogou三种图像搜索引擎功能
- 再不迷路:谷歌地图革命催生新产业
- google地球专业版
- paypal支付开发
- Google官网下拉刷新SwipeRefreshLayout
- In the Plex
- Google Cloud Platform for Architects Design an
- Site Reliability Engineering: How Google Runs
- Paypal&API;的中文开发文档
- Google B4 DCI网络论文
- PDF的google翻译V1.2
- Google Deepmind AlphaGo原理解析完整54页
- libkml-1.2
- Google S2chm版本帮助文档
- dotnet-支付宝Alipay服务端SDK采用NETSta
评论
共有 条评论