Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should note there are some very misleading errors and dialogs displayed in the demo Dungeons.java:</p> <p>--</p> <p>If you are getting "Error: This version of the application is not configured for Market billing."</p> <p>You must installed the <em>RELEASE</em> apk to your android <em>DEVICE</em> not emulator meaning: </p> <ul> <li><p>Exporting your APK and signing it</p></li> <li><p>Deleting any previous installation of your app on your device (even debug / developer versions!)</p></li> <li><p>Side loading the APK to your device, installing it, and running it.</p></li> <li><p>This also means debugging your released app is probably going to be without your debugger attached. If your debugger is attached, do tell me how!</p></li> </ul> <p>If you are getting "Error: Item not found", there's a decent chance there is nothing wrong.</p> <p>Dungeons.java actually has a bug in it. Let me explain:</p> <pre><code>/** * Called when a button is pressed. */ @Override public void onClick(View v) { if (v == mBuyButton) { if (Consts.DEBUG) { Log.d(TAG, "buying: " + mItemName + " sku: " + mSku); } if (mManagedType != Managed.SUBSCRIPTION &amp;&amp; // ** The following line is bug when returns !true which is false, and then makes the if statement false !mBillingService.requestPurchase(mSku, Consts.ITEM_TYPE_INAPP, mPayloadContents)) { showDialog(DIALOG_BILLING_NOT_SUPPORTED_ID); // ** Which then ends up running this else if, meaning it will try to purchase a subscription } else if (!mBillingService.requestPurchase(mSku, Consts.ITEM_TYPE_SUBSCRIPTION, mPayloadContents)) { // Note: mManagedType == Managed.SUBSCRIPTION showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); } } else if (v == mEditPayloadButton) { showPayloadEditDialog(); } else if (v == mEditSubscriptionsButton) { editSubscriptions(); } } </code></pre> <p>Rather it should be written like this:</p> <pre><code>/** * Called when a button is pressed. */ @Override public void onClick(View v) { if (v == mBuyButton) { if (Consts.DEBUG) { Log.d(TAG, "buying: " + mItemName + " sku: " + mSku); } // We need this statement to evaluate to true on a Non-Subscription such as a Managed or Unmanaged Purchase if (mManagedType != Managed.SUBSCRIPTION) { // If the following errors out, show an error dialog. However, it should not make the previous if statement false if( !mBillingService.requestPurchase(mSku, Consts.ITEM_TYPE_INAPP, mPayloadContents)) { showDialog(DIALOG_BILLING_NOT_SUPPORTED_ID); } } // This if statement gets run accidentally without the bug fix, thus trying to buy your "SKU" as a "subscription", which is totally wrong! else if (!mBillingService.requestPurchase(mSku, Consts.ITEM_TYPE_SUBSCRIPTION, mPayloadContents)) { // Note: mManagedType == Managed.SUBSCRIPTION showDialog(DIALOG_SUBSCRIPTIONS_NOT_SUPPORTED_ID); } } else if (v == mEditPayloadButton) { showPayloadEditDialog(); } else if (v == mEditSubscriptionsButton) { editSubscriptions(); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload