If you think the Android project mint 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.gmail.altakey.mint.model;
//www.java2s.comimport android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
publicclass Schema {
publicstaticfinal String DATABASE = "toodledo";
publicstaticfinalint VERSION = 1;
publicstaticclass OpenHelper extends SQLiteOpenHelper {
public OpenHelper(final Context ctx) {
super(ctx, DATABASE, null, VERSION);
}
@Override
publicvoid onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE IF NOT EXISTS tasks (_id INTEGER PRIMARY KEY AUTOINCREMENT, cookie VARCHAR UNIQUE, task BIGINT UNIQUE, title TEXT, note TEXT, modified BIGINT, completed TEXT, folder BIGINT, context BIGINT, priority INTEGER, star INTEGER, duedate BIGINT, duetime BIGINT, status BIGINT)");
db.execSQL("CREATE TABLE IF NOT EXISTS folders (_id INTEGER PRIMARY KEY AUTOINCREMENT, modified BIGINT, folder BIGINT UNIQUE, name TEXT, private TEXT, archived TEXT, ord TEXT)");
db.execSQL("CREATE TABLE IF NOT EXISTS contexts (_id INTEGER PRIMARY KEY AUTOINCREMENT, context BIGINT UNIQUE, name TEXT)");
db.execSQL("CREATE TABLE IF NOT EXISTS statuses (_id INTEGER PRIMARY KEY AUTOINCREMENT, status BIGINT UNIQUE, name TEXT UNIQUE)");
/* Status initial content */
db.execSQL("INSERT INTO statuses (status, name) VALUES (0, 'INBOX')");
db.execSQL("INSERT INTO statuses (status, name) VALUES (-1, 'Hotlist')"); // XXX
db.execSQL("INSERT INTO statuses (status, name) VALUES (1, 'Next Action')");
db.execSQL("INSERT INTO statuses (status, name) VALUES (10, 'Reference')");
db.execSQL("INSERT INTO statuses (status, name) VALUES (5, 'Waiting')");
db.execSQL("INSERT INTO statuses (status, name) VALUES (8, 'Someday')");
}
@Override
publicvoid onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
};
}