Created
August 13, 2010 18:56
-
-
Save ecton/523363 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class UserDatabase { | |
| static SQLiteDatabase database; | |
| static public SQLiteDatabase getDatabase(Context ctx) { | |
| if (database == null) { | |
| database = ctx.openOrCreateDatabase("user.sqlite3", SQLiteDatabase.OPEN_READWRITE, null); | |
| database.execSQL("CREATE TABLE IF NOT EXISTS userScheduleItems (rowid INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT COLLATE NOCASE, color INTEGER, duration REAL, isFromServer INTEGER, date REAL, isExternal INTEGER, scheduleServerId TEXT COLLATE NOCASE, notes TEXT COLLATE NOCASE, isDeleted INTEGER, exhibitorServerId TEXT COLLATE NOCASE)"); | |
| } | |
| return database; | |
| } | |
| static void bookmark(Context ctx, String scheduleId, String name, double date, double duration) { | |
| getDatabase(ctx).execSQL("INSERT INTO userScheduleItems (scheduleServerId, name, date, duration, color) VALUES (?, ?, ?, ?, ?)", | |
| new String[]{ | |
| scheduleId, | |
| name, | |
| Double.toString(date), | |
| Double.toString(duration), | |
| Integer.toString(0x0020C0) | |
| } | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment