如何设定价格?应用内结算

时间:2016-06-03 08:48:39

标签: android

我正在尝试在我的应用中实施应用内结算功能。我使用谷歌的教程https://developer.android.com/google/play/billing/billing_integrate.html。  以下是该教程中的一段我不理解的代码。

int response = skuDetails.getInt("RESPONSE_CODE");

if (response == 0) {
   ArrayList<String> responseList
      = skuDetails.getStringArrayList("DETAILS_LIST");

   for (String thisResponse : responseList) {
      JSONObject object = new JSONObject(thisResponse);
      String sku = object.getString("productId");

      String price = object.getString("price");   !!!

     if (sku.equals("premiumUpgrade")) mPremiumUpgradePrice = price;
      else if (sku.equals("gas")) mGasPrice = price;
   }
}

他们从哪里买价?我忽略了该页面上的整个代码,并没有发现任何与设定价格有关的事情。

感谢。

2 个答案:

答案 0 :(得分:0)

这是因为您在Google Play Developer Console中设置了价格。

转到您的应用。 左侧菜单 - &gt; 应用内商品 - &gt; 添加新产品

然后您的应用会从Google Play服务器中获取价格。

答案 1 :(得分:0)

价格实际上是在开发者控制台中设定的......