0

In my app I have done the below code in the dungeons sample project to check whether the item is purchased or not and changing my text of a list item :

@Override
        public void onPurchaseStateChange(PurchaseState purchaseState,
                String itemId, int quantity, long purchaseTime,
                String developerPayload) {
            if (Consts.DEBUG) {
                Log.i("Tag", "onPurchaseStateChange() itemId: " + itemId + " "
                        + purchaseState);
            }

            if (purchaseState == PurchaseState.PURCHASED) {
                ownedItems.add(itemId);
                list.get(purchaseposition).setPurchase("Play");
                adapter.notifyDataSetChanged();
            }
            // YOU can also add other checks here
        }

but when I re run the application it can not remember that I have already bought the item and it prompt me to buy it again. How can i do this? Its looking a little bit of complicated for me.

Reyjohn
  • 2,654
  • 9
  • 37
  • 63

1 Answers1

0

There are two types of in app purchase, one is managed and other is un-managed for managed items the play.google will take care of the item even after reinstallation of application on device while for un-managed you have to take care of the purchases by yourself. as you can see details in below link http://developer.android.com/guide/market/billing/billing_admin.html#billing-purchase-type

also answer to this question explaining the difference between managed and un managed products

Difference between managed and unmanaged in-app product android?

Community
  • 1
  • 1
Umar Qureshi
  • 5,985
  • 2
  • 30
  • 40