If you think the Android project mobile-connector-sdk-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
package com.silverpop.engage.store;
/*fromwww.java2s.com*/import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.util.Log;
/**
* Created by jeremydyer on 5/19/14.
*/publicclass EngageSQLiteHelper
extends SQLiteOpenHelper {
publicstaticfinal String TABLE_ENGAGE_EVENTS = "engageevents";
publicstaticfinal String COLUMN_ID = "_id";
publicstaticfinal String COLUMN_EVENT_TYPE = "eventType";
publicstaticfinal String COLUMN_EVENT_JSON = "eventJson";
publicstaticfinal String COLUMN_EVENT_STATUS = "eventStatus";
publicstaticfinal String COLUMN_EVENT_DATE = "eventDate";
publicstaticfinal String COLUMN_EVENT_FAILURE_COUNT = "eventFailureCount";
publicstaticfinal String DATABASE_NAME = "EngageTesting.db";
privatestaticfinalint DATABASE_VERSION = 2;
// Database creation sql statement
privatestaticfinal String DATABASE_CREATE = "create table "
+ TABLE_ENGAGE_EVENTS + "(" + COLUMN_ID
+ " integer primary key autoincrement, " + COLUMN_EVENT_TYPE
+ " int not null, " + COLUMN_EVENT_JSON + " text not null, " + COLUMN_EVENT_STATUS
+ " int not null, " + COLUMN_EVENT_DATE + " int not null, "
+ COLUMN_EVENT_FAILURE_COUNT + " int not null);";
public EngageSQLiteHelper(Context context) {
super(context, DATABASE_NAME, null, DATABASE_VERSION);
}
@Override
publicvoid onCreate(SQLiteDatabase sqLiteDatabase) {
sqLiteDatabase.execSQL(DATABASE_CREATE);
}
@Override
publicvoid onUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {
Log.w(EngageSQLiteHelper.class.getName(),
"Upgrading database from version " + oldVersion + " to "
+ newVersion + ", which will destroy all old data"
);
sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + TABLE_ENGAGE_EVENTS);
onCreate(sqLiteDatabase);
}
}