在Android应用内结算中更新数据库的位置?

时间:2012-07-11 13:51:01

标签: android in-app-billing

我下载了Android应用程序内的计费示例“Dungeons”应用程序,我测试了它。但我不想使用它的数据库。我想更新我自己的数据库,但我找不到我在哪里可以更新我的已购买回复的数据库?

1 个答案:

答案 0 :(得分:1)

    private class DungeonsPurchaseObserver extends PurchaseObserver {
    public DungeonsPurchaseObserver(Handler handler) {
        super(BusinessPunkBase.this, handler);
    }

    @Override
    public void onBillingSupported(boolean supported) {
            //Here you can update your DB

    }

    @Override
    public void onPurchaseStateChange(PurchaseState purchaseState,
            String itemId, int quantity, long purchaseTime,
            String developerPayload) {
        //Here you can update your DB

    }

    @Override
    public void onRequestPurchaseResponse(RequestPurchase request,
            ResponseCode responseCode) {

    }

    @Override
    public void onRestoreTransactionsResponse(RestoreTransactions request,
            ResponseCode responseCode) {
        //Here you can update
    }
}