Android 如何定价?应用内计费
我正在尝试在我的应用中实现应用内计费。我使用谷歌的教程。 这是那个教程中我不理解的一段代码Android 如何定价?应用内计费,android,Android,我正在尝试在我的应用中实现应用内计费。我使用谷歌的教程。 这是那个教程中我不理解的一段代码 int response = skuDetails.getInt("RESPONSE_CODE"); if (response == 0) { ArrayList<String> responseList = skuDetails.getStringArrayList("DETAILS_LIST"); for (String thisResponse : respo
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;
}
}
int response=skuDetails.getInt(“response_code”);
如果(响应==0){
ArrayList响应列表
=skuDetails.getStringArrayList(“详细信息列表”);
for(字符串thisResponse:responseList){
JSONObject对象=新的JSONObject(此响应);
String sku=object.getString(“productId”);
String price=object.getString(“price”)!!!
如果(sku.等于(“premiumUpgrade”))mPremiumUpgradePrice=价格;
否则,如果(sku.等于(“天然气”))mGasPrice=价格;
}
}
他们从哪里获得价格???我忽略了页面上的全部代码,没有发现任何与定价相关的内容
谢谢。这是因为你设定了价格 转到你的应用程序。左菜单->应用内产品->添加新产品
然后你的应用程序将从Google Play服务器获取价格。价格实际上是在开发者控制台中设定的