5

目前我正在试验“应用内计费 V3”。根据谷歌的说法,我必须创建一个服务,所以我已经做到了,但我无法绑定。

这是我的代码:

主要活动:

Intent("com.android.vending.billing.InAppBillingService.BIND"),
                    mServiceConn, Context.BIND_AUTO_CREATE);

我也有这个:

IInAppBillingService mService;

ServiceConnection mServiceConn = new ServiceConnection() {

     public void onServiceConnected(ComponentName name, 
              IBinder service) {

                System.out.println("Test!");
               mService = IInAppBillingService.Stub.asInterface(service);
     }

     public void onServiceDisconnected(ComponentName name) {
       mService = null;
     }


};

在我的清单文件中,我有这个:

<service android:name="com.android.vending.billing.IInAppBillingService" />

我使用http://developer.android.com/google/play/billing/billing_integrate.html作为来源。

4

0 回答 0