Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom the android In-App purchased details

I have implemented In-App purchase in my application.But I need to custom the purchased details, with the time of purchase should come first and the amount of item purchased second, both in a row.Basically from the Dungeons example, it just shows only that column

android.test.purchased 1

I need something like this,

2012FEB1 2$ purchased

Can anyone help me to achieve this?

like image 234
hacker Avatar asked Feb 01 '12 12:02

hacker


1 Answers

You can retrieve the data from DB after your transaction completes!! hope this is helpful

 public void getdataFromDB() {
    db = openOrCreateDatabase("purchase.db", MODE_WORLD_WRITEABLE, null);

    cLocal = db.rawQuery("select * from history ", null);
    cLocal.moveToFirst();
    for (int z = 0; z < cLocal.getCount(); z++) {
        id = cLocal.getString(cLocal.getColumnIndex("_id"));
        productId = cLocal.getInt(cLocal.getColumnIndex("productId"));
        state = cLocal.getString(cLocal.getColumnIndex("state"));
        purchaseTime = cLocal.getString(cLocal
                .getColumnIndex("purchaseTime"));

        developerPayload = cLocal.getInt(cLocal
                .getColumnIndex("developerPayload"));

        if (z < (cLocal.getCount() - 1)) {
            cLocal.moveToNext();
        }
        Toast.makeText(getApplicationContext(), state,Toast.LENGTH_LONG).show();
        //Toast.makeText(getApplicationContext(), "Please wait",Toast.LENGTH_LONG).show();
    }

    //Toast.makeText(getApplicationContext(), "..."+productId+"..."+state+"..."+purchaseTime+"..."+developerPayload,Toast.LENGTH_LONG).show();


}
like image 143
LOG_TAG Avatar answered Sep 28 '22 13:09

LOG_TAG