i am developing android in-app application with static In-app Product ID: android. test. purchased that is working good and i also get
Toast message: Thank you.You item will be appear shortly.
but in actual Product ID:com.android.example not working properly.and i don’t know toast message class now i am what to do.
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
mainview=(ImageView)findViewById(R.id.comcontractsol);
mBillingObserver = new AbstractBillingObserver(this) {
@Override
public void onBillingChecked(boolean supported)
{
Dungeon.this.onBillingChecked(supported);
}
@Override
public void onPurchaseStateChanged(String itemId, PurchaseState state)
{
if(itemId.equals("android.test.purchased"))
{
mainview.setBackgroundResource(R.drawable.unlock);
Dungeon.this.onPurchaseStateChanged(itemId, state);
startActivity(new Intent(getApplicationContext(), secondActivity.class));
}
}
@Override
public void onRequestPurchaseResponse(String itemId, ResponseCode response)
{
Dungeon.this.onRequestPurchaseResponse(itemId, response);
}
}
If you want “com.android.example” as product id then you have to follow these steps:
Create .apk file and upload it in android market but do not publish it.
Find In-App purchase(items) link and create a product and publish it. The product name must be same as “com.android.example”. So I suggest you to use a meaningful product Id.
See this similar question
In order to test your application, you have to create test account see this link