@@ -0,0 +1,2041 @@
+public class DatabaseHelper extends SQLiteOpenHelper %7B%0A    // The tag will be used for logging%0A    public static final String TAG = %22MyDatabase%22;%0A%0A    // The name of your database%0A    public static final String DATABASE_NAME = %22mydatabase.db%22;%0A    // The version of your database (increment this every time you change something)%0A    public static final int DATABASE_VERSION = 1;%0A    // The name of the table in your database%0A    public static final String DB_TABLE_NAME = %22mytable%22;%0A   %0A    // The name of each column in the database%0A    public static final String _ID = BaseColumns._ID;%0A    public static final String TITLE = %22title%22;%0A    public static final String DESCRIPTION = %22description%22;%0A    public static final String TAGS = %22tags%22;%0A%0A    // SQL Statement to create a new database.%0A    public static final String DB_TABLE_CREATE =%0A        %22CREATE TABLE %22 + DB_TABLE_NAME + %22 (%22 +%0A        _ID + %22 INTEGER PRIMARY KEY AUTOINCREMENT, %22 +%0A        TITLE + %22 TEXT, %22 +%0A        DESCRIPTION + %22 TEXT, %22 +%0A        TAGS + %22 TEXT);%22;%0A   %0A    // The constructor method%0A    public DatabaseHelper(Context context) %7B%0A        super(context, DATABASE_NAME, null, DATABASE_VERSION);%0A    %7D%0A%0A    /* Called when the super class getWritableDatabase (or getReadableDatabase)%0A     * method determines that the database doesn't exist yet and needs to be created%0A     */%0A    @Override%0A    public void onCreate(SQLiteDatabase db) %7B%0A        db.execSQL(DB_TABLE_CREATE);       %0A    %7D%0A%0A    /* Called when the super class getWritableDatabase (or getReadableDatabase)%0A     * method determines that the existing database isn't the same version as%0A     * the latest version%0A     */%0A    @Override%0A    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) %7B%0A        Log.w(TAG, %22Upgrading database from version %22 + oldVersion + %22 to %22%0A                + newVersion + %22, which will destroy all old data%22);%0A        // this is probably not the best way to do it...%0A        db.execSQL(%22DROP TABLE IF EXISTS %22 + DB_TABLE_NAME);%0A        onCreate(db);%0A    %7D%0A%7D

add basic generic database helper class for android that handles creating and upgrading the database