Android Database Example
Database Class import java.util.ArrayList; import java.util.List; import android.content.Context; import android.database.Cursor; import android.database.sqlite.SQLiteDatabase; import android.database.sqlite.SQLiteOpenHelper; import android.database.sqlite.SQLiteStatement; import android.util.Log; public class DatabaseHelper { private static final String DATABASE_NAME = "firstdatabase.db"; private static final int DATABASE_VERSION = 1; private static final String TABLE_NAME = "mytable"; private Context context; private SQLiteDatabase sqlDb; private SQLiteStatement insertStatement; private static final String INSERT = "insert into " + TABLE_NAME + "(name) values (?)"; public DatabaseHelper(Context context) { this.context = context; OpenHelper openHelper = new OpenHelper(this.context); this.sqlDb = openHelper.getWritableDatabase(); this.insertStatement = this.sqlDb.compileStatement(INSERT); } public long insert(Strin...