In the Billing V3 Service nullpointer Android app

I am currently experimenting with In-app Billing V3. According to Google, I need to create a service, so I did it, but I canโ€™t get the binding.

This is my code:

Mainactivity:

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

I also have this:

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;
     }


};

And in my manifest file, I have the following:

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

I am using http://developer.android.com/google/play/billing/billing_integrate.html as a source.

+5
source share

All Articles