'''Originally Posted By: mcastagnolo'''
public class MySQLiteHelper extends SQLiteOpenHelper {<br>private Context context;<br><br>public MySQLiteHelper(Context context) {<br>super(context, &quot;SimpleDB&quot;, null, 1);<br>this.context = context;<br>}<br><br>@Override<br>public void onCreate(SQLiteDatabase database) throws SQLException {<br>database.execSQL(&quot;create table SimpleTable(SimpleColumn integer not null)&quot;);<br> database.execSQL(&quot;insert into SimpleTable values(5)&quot;);<br><br>}<br><br>@Override<br>public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {<br>// This method isn't necessary to implement, but is required to be here.<br>}<br><br>}<br><br>Driver Code<br><br>MySQLiteHelper dbHelper = new MySQLiteHelper(context);<br>dbHelper.getWriteableDatabase(); //Will execute the code in the onCreate method, creating the database and running the onCreate method.