Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import android.util.Log;

public class Main {
    public static final int MAX_PRODUCTS = 15;
    public static int g_iNumProducts = 0;
    public static int[] g_iPurchaseProductStates = new int[MAX_PRODUCTS];
    public static String[] g_sPurchaseProductNames = new String[MAX_PRODUCTS];
    public static int[] g_iPurchaseProductTypes = new int[MAX_PRODUCTS];

    public static void iapAddProduct(String name, int ID, int type) {
        name = name.toLowerCase();
        Log.w("IAB AddProduct", "Adding: " + name + " to ID: " + Integer.toString(ID));
        if (ID < 0 || ID >= MAX_PRODUCTS)
            return;
        g_iPurchaseProductStates[ID] = 0;
        g_sPurchaseProductNames[ID] = name;
        g_iPurchaseProductTypes[ID] = type;
        Log.w("IAB AddProduct", "Added: " + name);
        if (ID + 1 > g_iNumProducts)
            g_iNumProducts = ID + 1;
    }
}