Android库和App,用于测试Play商店的帐单-Android开发

  • C9_624538
    了解作者
  • 527.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-04-03 06:25
    上传日期
Register是一个Android库,可以更轻松地测试Google Play应用内结算。 问题的博客:问题:Android上的Google Play计费实现难以实现当涉及付款时,开发人员sle Register是一个Android库,可以更轻松地测试Google Play应用内计费。 问题的博客:问题:Android上的Google Play计费实施很难正确解决当涉及付款时,开发人员可以睡得更好,有一种方法可以在发布之前测试其功能在Play商店中将应用升级为Alpha之前,我们还没有一种测试付款的官方方式纽约时报Android团队开发了一种伪造的Google Play结算实施,称为Register,
Register-master.zip
内容介绍
<table> <tr> <td> <h3>DEPRECATED</h3> Register is deprecated. No more development will be taking place. Thanks for all your support! </td> </tr> </table> <br/><br/> [![Build Status](https://travis-ci.org/nytimes/Register.svg?branch=master)](https://travis-ci.org/nytimes/Register) ![Register Logo](https://github.com/nytm/register/blob/master/images/register-logo.png?raw=true) Register is an Android library for easier testing of Google Play's In-app Billing. [Blog Post](https://open.nytimes.com/register-better-in-app-billing-testing-on-android-73af5fcc36dc) ### The Problems: + Google Play Billing implementations on Android are hard to get right + When payments are involved, developers sleep better having a way to test their functionality prior to release + Before an app is promoted to Alpha in the Play Store, we do not have an offical way to test payments The New York Times Android Team developed a fake implementation of Google Play Billing called Register, which can be used as a companion app for testing Play Billing purchases and subscriptions. Similar to a mock web server, you can point your app to use Register rather than the real Play Store In-app Billing implementation. Using Register, you'll be able to validate in-advance whether your purchasing flows work correctly. Register has been used to test purchasing flows of our [Flagship Reader App](https://play.google.com/store/apps/details?id=com.nytimes.android&hl=en) and [NYT Crosswords App](https://play.google.com/store/apps/details?id=com.nytimes.crossword&hl=en) for three years and counting. ![Register Sample](https://github.com/nytm/register/blob/master/images/registerCompanion.png?raw=true) ### Overview Register is a companion app and library that allows seamless mocking of responses from Google Play Store Billing. Register works by implementing the same interface as the Google Play Store Billing library [Google Play Billing](https://developer.android.com/google/play/billing/billing_overview). You can find a sample app that highlights the features of Google Play Billing here: [Classy Taxi](https://github.com/qinci/android-play-billing/tree/master/ClassyTaxi) From a client's perspective, there is no difference in how you work with Google Play Billing or Register's implementation. If you've used [Amazon's IAP Tester Utility](https://developer.amazon.com/public/apis/earn/in-app-purchasing/docs-v2/testing-iap), you'll find Register's workflow to be very familiar. ### Using Register You can find the latest version of Register in the [Releases Tab](https://github.com/nytm/Register/releases) **Step 0:** Register needs a configuration file that declares the mock purchases, subscriptions and users that you will be testing against. Here's a sample that we use at NYTimes. The format needs to be the same as below when creating your own fake purchases. This JSON file (`register.json`) should be included in the assets folder of your module. ```json { "skus": { "register.sample.iap": { "type": "inapp", "price" : "1.00", "title" : "Sample In App Purchase Item", "description" : "This is an in app purchase item for use with Register sample app", "package" : "com.nytimes.android.external.register" }, "register.sample.sub": { "type": "subs", "price" : "10.00", "title" : "Sample Subscription Item1", "description" : "This is a subscription item for use with Register sample app", "package" : "com.nytimes.android.external.register" } }, "users": [ "user1@register.nytimes.com", "user2@register.nytimes.com" ] } ``` For Register to find the aforementioned configuration file (in case you change name or location), you need to change the data contained in the `configuration\configuration.properties` file: ``` ide.json.path=subfolder/from/root file.json.name=newFileName.json ``` **Step 1:** Add Register as a dependency to your client app, this will install the companion app: ```groovy compile 'com.nytimes.android:register-app:0.0.9' compile 'com.nytimes.android:register:0.0.9' ``` or, on Android Gradle Plugin 3.0 or later: ```groovy implementation 'com.nytimes.android:register-app:0.0.9' implementation 'com.nytimes.android:register:0.0.9' ``` **Step 2:** Create a test Google Service Provider (or a real provider): ```java private void initGoogleServiceProvider() { if (prefsManager.isUsingTestGoogleServiceProvider()) { googleServiceProvider = new GoogleServiceProviderTesting(); } else { googleServiceProvider = new GoogleServiceProviderImpl(); ``` **Step 3:** Make a purchase, similar to how you would with the regular In-app Billing API. ![Register Sample](https://github.com/nytm/register/blob/master/images/purchase.png?raw=true) **Step 4:** Go to the companion app to view the purchase. ![Register Sample](https://github.com/nytm/register/blob/master/images/purchased.png?raw=true) ### Fully Configurable (Configuration App) Register's companion app allows you to view both successful and unsuccessful purchases directly on your Android device. Additionally, you can control responses back to your client app for values such as `getSkuDetails`. See the image below for all configurable options on a response. ![Register Sample](https://github.com/nytm/register/blob/master/images/registerCompanion.png?raw=true) ### Sample App **SampleApp** is a client app that showcases working with Register. See [SampleActivity](https://github.com/nytimes/Register/blob/master/sampleApp/src/main/java/com/nytimes/android/external/register/sample/SampleActivity.kt) for a demo of the purchasing flow. ### Gradle **For Android Gradle Plugin 3.0** ```groovy implementation 'com.nytimes.android:register-app:0.0.9' implementation 'com.nytimes.android:register:0.0.9' ``` **For projects using older versions of the plugin** ```groovy compile 'com.nytimes.android:register-app:0.0.9' compile 'com.nytimes.android:register:0.0.9' ```
评论
    相关推荐
    • 阿里巴巴Android开发手册PDF
      《阿里巴巴Android开发手册》。该开发规范在阿里内部经过了长期的修缮,现已总结成册,向所有移动开发者、技术爱好者开放,希望帮助开发者码出高效、码出质量,提升系统的质量、协作的高效性。
    • Android手机游戏开发有关资料
      里面有很多内容啊 关于Android的入门
    • Android开发基础培训
      通过本PDF,可迅速掌握Android开发的基本知识,PDF中包含代码,可直接通过AndroidStudio拷贝进行演示,便于理解代码
    • Android开发规范
      Android开发规范,包括命名规范,书写规范,适合开发团队内部统一沟通。
    • Android开发帮助文档
      Android开发帮助文档,Android开发帮助文档,Android开发帮助文档,
    • Android 开发手册
      为了更好的开发 ,优雅的编码请看 Android 开发注意事项
    • android 开发
      android 开发,从大学创业开始算做了12年开发了,做了8年的自由职业者,做了8年移动开发,5年电子商务,有超过5年的讲课经历 , 培训对象包括中国移动,中国联通 , 上海贝尔 , 白象集团 ,中国邮政, 河南社保 , ...
    • Android大冒险软件
      自己团队开发的软件,包含猜数,真心话,大冒险,抓内奸等聚会常玩的小游戏
    • android项目
      android事务管理器,android团队开发项目
    • SIM800C_MQTT.rar
      使用SIM800C模块,使用MQTT协议,连接中国移动onenet平台,能实现数据的订阅、发布、存储等