资源简介
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
- 下一篇:建筑物的地面扫描点云数据
相关资源
- 用foobar2000听google音乐[更新一下]
- Google Earth KML文件生成工具
- google earth 高程点坐标提取软件
- Google架构安全白皮书
- Google Earth在地质勘探中的应用
- 流媒体相关协议标准RTP/RTSP/RTCP PDF文档
- The datacenter as a computer_Final-Draft
- Google OCR API源代码和神经网络识别OC
- Google DeepMind的David Silver的强化学习课
- Google论文\“Wide & Deep Learning for Recom
- 微信支付预订单、查询、退款等接口
- googlemappoi内容解析
- csv 转换为google earth的轨迹kml
- studypay download 在线ts流视频自动批量并
- .net支付宝支付
- Google Chrome 49.0.2623.110 便携版(免安装
- weChatpay完整版.zip
- arcmap中加载谷歌地图ArcBruTile
- Introduction to Machine Learning Ethem ALPAYDI
- 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拼图工具
评论
共有 条评论