title: how to implement app id in app subscription android
body: <p>i have followed some example for in app subscription but i am not sure that where to put app_id which is generated in google play store ..please help me for this small thing..</p>
  
  <p>this my class this work for test but don't know how to implement in real case</p>
  
  <pre><code>public class MainActivity extends ActionBarActivity implements OnClickListener {
  
  private WebView webView;
  private Button subscription;
  IInAppBillingService mservice;
  ServiceConnection connection;
  String inappid = "android.test.purchased";
  
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      connection = new ServiceConnection() {
  
          @Override
          public void onServiceDisconnected(ComponentName name) {
              mservice = null;
  
          }
  
          @Override
          public void onServiceConnected(ComponentName name, IBinder service) {
              mservice = IInAppBillingService.Stub.asInterface(service);
          }
      };
  
      bindService(new Intent(
              "com.android.vending.billing.InAppBillingService.BIND"),
              connection, Context.BIND_AUTO_CREATE);
  }
  
  
  
  public void showDialog(View v) {
      ArrayList skuList = new ArrayList();
              skuList.add(inappid);
              Log.i("TAG", "CLICK");
              Bundle querySkus = new Bundle();
              querySkus.putStringArrayList("ITEM_ID_LIST", skuList);
              Bundle skuDetails;
              try {
                  skuDetails = mservice.getSkuDetails(3, getPackageName(),
                          "inapp", querySkus);
  
                  int response = skuDetails.getInt("RESPONSE_CODE");
                  if (response == 0) {
  
                      ArrayList&lt;String&gt; responseList = skuDetails
                              .getStringArrayList("DETAILS_LIST");
  
                      for (String thisResponse : responseList) {
                          Log.i("PRICE_TAG", thisResponse);
                          JSONObject object = new JSONObject(thisResponse);
                          String sku = object.getString("productId");
                          String price = object.getString("price");
                          if (sku.equals(inappid)) {
                              System.out.println("price " + price);
                              Bundle buyIntentBundle = mservice
                                      .getBuyIntent(3, getPackageName(), sku,
                                              "inapp",
                                              "bGoa+V7g/yqDXvKRqq+JTFn4uQZbPiQJo4pf9RzJ");
                              PendingIntent pendingIntent = buyIntentBundle
                                      .getParcelable("BUY_INTENT");
                              startIntentSenderForResult(
                                      pendingIntent.getIntentSender(), 1001,
                                      new Intent(), Integer.valueOf(0),
                                      Integer.valueOf(0), Integer.valueOf(0));
                          }
                      }
                  }
              } catch (RemoteException e) {
  
                  Toast.makeText(getBaseContext(), "Remote erroer",
                          Toast.LENGTH_SHORT).show();
              } catch (JSONException e) {
  
                  Toast.makeText(getBaseContext(), "json error",
                          Toast.LENGTH_SHORT).show();
              } catch (SendIntentException e) {
  
                  Toast.makeText(getBaseContext(), "sending intent error",
                          Toast.LENGTH_SHORT).show();
              }
  
  }
  
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
      if (requestCode == 1001) {
          String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
  
          if (resultCode == RESULT_OK) {
              try {
                  JSONObject jo = new JSONObject(purchaseData);
                  String sku = jo.getString(inappid);
                  Toast.makeText(
                          MainActivity.this,
                          "You have bought the " + sku
                                  + ". Excellent choice,adventurer!",
                          Toast.LENGTH_LONG).show();
  
              } catch (JSONException e) {
                  Toast.makeText(this.getBaseContext(),
                          "Failed to parse data", Toast.LENGTH_SHORT).show();
              }
          }
      }
  }
  
  @Override
  public void onDestroy() {
      super.onDestroy();
      if (connection != null) {
          unbindService(connection);
      }
  }
  
  @Override
  public void onClick(View arg0) {
      showDialog(arg0);
  
  }
  </code></pre>