Android - how to verify an in-app purchase?
<p>I'm trying learn about in-app purchases by following this tutorial <a href="http://blog.blundell-apps.com/simple-inapp-billing-payment/" rel="nofollow">http://blog.blundell-apps.com/simple-inapp-billing-payment/</a></p>

<p>here's my code so far:</p>

<pre><code>public class main extends Activity{

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e("BillingService", "Starting");
        setContentView(R.layout.main);

        startService(new Intent(this, BillingService.class));
        BillingHelper.setCompletedHandler(mTransactionHandler);

    }

    ////////////////////////////////

    public Handler mTransactionHandler = new Handler(){
            public void handleMessage(android.os.Message msg) {

                Log.e("IN APP", "Transaction complete");
                Log.e("IN APP", "Transaction status: "+BillingHelper.latestPurchase.purchaseState);
                Log.e("IN APP", "Item purchased is: "+BillingHelper.latestPurchase.productId);

                if(BillingHelper.latestPurchase.isPurchased())
                {
                    showItem();
                }

            };

    };

    ////////////////////////////////

    public void BuyButtonClick(View v) {

        if(BillingHelper.isBillingSupported()){
            Log.e("IN APP","Trying to buy...");
            BillingHelper.requestPurchase(this, "android.test.purchased"); 
        } else {
            Log.e("IN APP","Can't purchase on this device");
        }

    }

    ////////////////////////////////////////////////

    private void showItem() {

        TextView tv1 = (TextView)findViewById(R.id.tv1);
        tv1.setText("PAID!");

    }

    ////////////////////////////////////////////////

    @Override
    protected void onDestroy() {
        BillingHelper.stopService();
        super.onDestroy();
    }

    ////////////////////////////////

}
</code></pre>

<p>Everything seems to work fine, but I also want some way to check if the item was purchased when the app starts. I assume it might use <strong>BillingHelper.verifyPurchase(signedData, signature)</strong> , but what data and sig should I put in there? Or maybe there's some other way about it?</p>

<p>Thanks!</p>
