Skip to main content
Samsung Developer Program

Initialize IAP Helper

You modify your Android app's MainActivity class in order to support the sale of in-app items registered to your Android app

The example code in this section demonstrates how to: implement a listener,  hard code an in-app item ID, instantiate an IapHelper object, and set the IAP operating mode.

For more details, see:

public class MainActivity extends AppCompatActivity implements OnPaymentListener {
    // Please change ITEM_ID for your application's in-app items.     
    // ========================================================================     
    private static final String ITEM_ID  = "Nuclear";     
    // ========================================================================

    private IapHelper    mIapHelper  = null;

    protected void onCreate(Bundle savedInstanceState) {         
        mIapHelper = IapHelper.getInstance(this);