Android应用内结算v3

时间:2014-06-04 04:21:40

标签: android google-play payment in-app-billing

美好的一天!

我正在为我的应用实施应用内结算v3。我按照Android教程中的所有步骤进行了操作,但它说"找不到应用程序"

我将apk文件上传到Alpha版本。 创建产品列表。 我在测试人员名单中。 包名称相同。

    super.onCreate(savedInstanceState);
    bindService(new 
            Intent("com.android.vending.billing.InAppBillingService.BIND"),
                    mServiceConn, Context.BIND_AUTO_CREATE);

    case R.id.ss_next:
        startService(new Intent(this, service_test.class).setFlags(3));

        break;
    case R.id.d_bok:
        stopService(new Intent(this, service_test.class));
        ArrayList<String> skuList = new ArrayList<String> ();
        skuList.add("premiumUpgrade");
        skuList.add("gas");
        Bundle querySkus = new Bundle();
        querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
        try {
            Bundle buyIntentBundle = mService.getBuyIntent(3, "",
                    "25coins", "i", "b");

            PendingIntent pendingIntent = buyIntentBundle.getParcelable("BUY_INTENT");
            startIntentSenderForResult(pendingIntent.getIntentSender(),
                       1001, new Intent(), Integer.valueOf(0), Integer.valueOf(0),
                       Integer.valueOf(0));
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (SendIntentException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

提前致谢!

1 个答案:

答案 0 :(得分:1)

您必须在AndroidManifest.xml中设置:

<!-- VERY IMPORTANT! Don't forget this permission, or in-app billing won't work. -->
<uses-permission android:name="com.android.vending.BILLING" />