title: Problems binding Google InAppBillingService
body: <p>I'm trying to implement In App Billing use the reference from <a href="http://developer.android.com/google/play/billing/billing_integrate.html" rel="nofollow">here</a></p>
  
  <p>I followed the instructions, but ran into trouble binding the InAppBillingService.
  It would seem that my ServiceConnection's onServiceConnected(...) method never gets called, and that method is responsible for creating my InAppBillingService Interface.</p>
  
  <p>Furthermore, context.bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE) returns false every time, indicating some sort of problem. Maybe InAppBilling isnt available for some reason, isBillingSupported(...) is returning false. I am not using an emulator.</p>
  
  <p>Here is my class :</p>
  
  <pre><code>public class GoogleShop extends Shop {
  
      private ServiceConnection serviceConnection;
      private IInAppBillingService service;
  
      public GoogleShop() {
          this.serviceConnection = new ServiceConnection() {
              @Override
              public void onServiceDisconnected(ComponentName name) {
                  service = null;
              }
  
              @Override
              public void onServiceConnected(ComponentName name, IBinder binder) {
                  service = IInAppBillingService.Stub.asInterface(binder);
              }
          };
      }
  
      public void bindService(Context context) {
          Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
          serviceIntent.setPackage("com.android.vending");
  
          System.out.println("InAppBillingAvailable : " + GoogleShop.isBillingAvailable(context));
          if (context.bindService(serviceIntent, serviceConnection, Context.BIND_AUTO_CREATE))
              return;
          else
              throw new RuntimeException("BindService returned false");
      }
  
      public ServiceConnection service() {
          return serviceConnection;
      }
  
      public static boolean isBillingAvailable(Context context) {
          final PackageManager packageManager = context.getPackageManager();
          final Intent intent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
          List&lt;ResolveInfo&gt; list = packageManager.queryIntentServices(intent, 0);
          return list.size() &gt; 0;
      }
  }
  </code></pre>
  
  <p>Also, I didn't forget to add</p>
  
  <pre><code>&lt;uses-permission android:name="com.android.vending.BILLING" /&gt;
  </code></pre>
  
  <p>to my Manifest</p>