示例#1
0
 @Override
 public void request(Hashtable<String, String> products) {
   Log.d("IabTest", "requesting");
   SparseArray<Bundle> arr = new SparseArray<Bundle>();
   int i = 0;
   Enumeration<String> e = products.keys();
   while (e.hasMoreElements()) {
     String prodName = e.nextElement();
     Bundle map = new Bundle();
     Log.d("IabTest", "ProdName: " + prodName + "; sku: " + products.get(prodName));
     map.putString("productId", products.get(prodName));
     map.putString("title", "Test product " + i);
     map.putString("description", "Product for testing");
     map.putString("price", "1.99");
     arr.put(i, map);
     i++;
   }
   Iab.productsComplete(this, arr);
   Iab.productsError(this, "Test Products Error");
 }
示例#2
0
 @Override
 public void restore() {
   Log.d("IabTest", "restoring");
   Iab.restoreComplete(this);
   Iab.restoreError(this, "Test Restore Error");
 }
示例#3
0
 @Override
 public void purchase(String productId) {
   Log.d("IabTest", "purchasing: " + productId);
   Iab.purchaseComplete(this, productId, "test_receipt");
   Iab.purchaseError(this, "Test Purchase Error");
 }
示例#4
0
 @Override
 public void check() {
   Log.d("IabTest", "checking");
   Iab.available(this);
   Iab.notAvailable(this);
 }