使用Eclipse调试Android的inapp计费 [英] Debug Android inapp billing using Eclipse

查看:170
本文介绍了使用Eclipse调试Android的inapp计费的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我成功地签署APK(使用Eclipse的Andr​​oid工具)和 ADB安装.. 到设备上进行测试。

Now I managed to sign the apk (using Eclipse Android Tools) and adb install .. to the device for testing.

但是,这去掉了调试功能,例如跳过,这使问题跟踪更加困难。

But this removed the debug function, e.g. "step over" which make problem tracing much more difficult.

是否可以使用Eclipse调试inapp计费?

Is it possible to debug the inapp billing using Eclipse?

推荐答案

当你通过在应用程序内结算文档,你还挺明白,它可能需要很长时间大量了解这个复杂的科技产品。大多数开发人员觉得需要一个工作的HelloWorld,再后来玩的基础之上。

When you go through the in app billing documentation, you kinda realize that it can take substantial amount of time to understand this complex piece of technology. Most developers feel the need for a working HelloWorld, and then later play around with the builds.

  1. Android的示例项目。您可以下载这个项目,并立即运行示例。这将帮助你快速调试/跟踪直通,并找出如何在应用程序内结算的作品。

  1. The android sample project. You can download this project, and immediately run the sample. This will help you quickly debug/trace thru and figure out how the in app billing works.

一个清理项目,以帮助您快速融入您的应用程序。这可以帮助就像一个图书馆。只是集成在您的结算按钮操作让你的购买请求。

A cleaned up project to help you integrate your app quickly. This can help like a library. Just integrate make your "purchase requests" on your "checkout" button action.

提醒你:我还没有纳入的安全建议。阅读的android应用程序中的计费文件。在那之前,你是你自己的风险。

  • 在下载 http://www.4shared.com/file/f5wH3qke/InAppBilling1。 HTML
  • 所有的信件(为什么,我下面会解释)创建一个新的Gmail帐户
  • 在支付了$ 25,购买了市场广场的帐户。
  • 导入项目到Eclipse环境
  • 创建一个签名的应用程序APK,文​​件导出,选择你的项目,创建或使用密钥库,它应该是有效的,从今天的25年。
  • 上传签名的APK到市场上作为一个应用程序草案,不公布它。
  • 对于上传的APK,你需要添加在应用产品。你会发现在主页上链接为您上传的APK。
  • 在Security.java不要忘记从你的市场账户编辑个人资料页面中添加你的公用钥匙。
  • 在在应用产品目录,你需要逐一添加下列产品之一
    • 在下面的文本应作为在应用产品ID
    • 在sword_001作为托管
    • 在potions_001作为非管理型
    • 标题和说明不事(用于测试目的)。添加你所需要的位置。
    • 成本增加1 $(最小)
    • Download "http://www.4shared.com/file/f5wH3qke/InAppBilling1.html"
    • Create a new gmail account for all correspondence (Why, I will explain below)
    • Pay that 25$ and purchase a "Market Place" account.
    • Import the project to your eclipse environment
    • Create a signed application apk, File-Export-Select Your Project-Create OR Use keystore, it should be valid for 25 years from today.
    • Upload the signed apk to the market place as a "Draft Application", DO NOT PUBLISH it.
    • For the uploaded apk, you need to add "In App Products". You will find this link on the home page for your uploaded apk.
    • In Security.java dont forget to add your "public key" from your market place account "edit profile" page.
    • On the "In App Product List", you need to add the following products one by one
      • The text below should used as "In app Product id"
      • sword_001 as Managed
      • potions_001 as Unmanaged
      • Title and Description dont matter (for testing purpose). Add what you need here.
      • Cost add 1$ (minimum)

      在应用程序项目发布(不要感到困惑在这里,你只需要发布的应用程序的产品,而不是APP)

      Publish the in app project (dont get confused here, you only need to publish the in app product, NOT the APP)

      • 在测试帐户,在这里添加您的个人Gmail ID。现在,这个gmail帐号需要配置为您的手机上你的第一个Gmail帐户。
      • 是的,在你的模拟器这不会工作
      • 现在,示例应用程序应该工作。

      下载 http://www.4shared.com/file/h8YnJyf_/InAppBillingIntegration。 HTML

      要整合,在您的通话活动初始化结账code

      To integrate, in your calling activity initialize the checkout code

      Handler handler = new Handler() ;
      CheckoutPurchaseObserver checkout = new CheckoutPurchaseObserver(this, handler);
      

      要发送结账的要求为您的产品

      To send the checkout request for your product

      checkout.sendCheckoutRequest(purchaseUri.toString(),null);
      

      重要提示:

      • 在这purchaseUri是你的资源的在应用内产品ID market.android.com/publish - >创建新的应用内商品 选项。该字符串应该设置为的应用产品的ID。
      • 这就是为什么 ID 是最重要的。在应用内产品ID 你是怎么指的是特定的产品。
      • 此外,在Security.java不要忘记添加公钥从市场帐户的编辑个人资料的页面。**
      • This purchaseUri is the "In-app Product ID" of your resource on the "market.android.com/publish-->Create New In-App Product" options. This string should be set as the "in app product" id.
      • That’s why the "id" is most important. The "In-App Product ID" is how you refer to that particular product.
      • Also, in Security.java dont forget to add your "public key" from your market place account "edit profile" page.**
      • 在LogCat中会显示所有的错误,InAppBilling标签
      • 在该项目创建了一个名为inappbilling一shared_ preferences和调试设置为true
      • 的Andr​​oidManifest.xml中可能没有必要的,因为本项目不 有一个主屏幕。
      • LogCat will show all errors as InAppBilling tag
      • This project creates a shared_preferences named "inappbilling" And debug is set to true
      • The androidmanifest.xml may not be needed since this project does not have a home screen.

      简单。您购买市场上的帐户,该帐户不能用于试验你在app计费。既然你不能购买的产品为自己。而你的设备上的主账户应设置为在市场上的帐户测试账号。这里鸡先有蛋的问题。希望其明确的。

      Simple. The account you purchase your market place account for, cant be used for "testing" your in app billing. Since you cannot purchase products for yourself. And your primary account on your device should be set as a "test account" on the market place account. Chicken-Egg issue here. Hope its clear.

      这是有趣的博客,我来过 HTTP ://crazyviraj.blogspot.com/2011/06/some-notes-on-implementing-in-app.html (不是我的)

      An interesting blog I came by "http://crazyviraj.blogspot.com/2011/06/some-notes-on-implementing-in-app.html" (not mine).

      这篇关于使用Eclipse调试Android的inapp计费的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆