I\'m working with databases and I have the following DataBaseHandling class:
public class DatabaseHandler extends SQLiteOpenHelper {
// All Static variables
//
There is a problem that you have missed a space at the Key_basal and also placed an extra comma at the end of your onCreate method. Your code :
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_MEASURES_TABLE = "CREATE TABLE " + TABLE_MEASURES + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_DATE + " TEXT,"
+ KEY_TIME_HOUR + " INTEGER NOT NULL," + KEY_TIME_MINUTE
+ " INTEGER NOT NULL," + KEY_BE_INTAKE + " REAL NOT NULL,"
+ KEY_GLUCOSE + " REAL NOT NULL," + KEY_BOLUS
+ " REAL NOT NULL," + KEY_BASAL + "REAL NOT NULL," + ")";
db.execSQL(CREATE_MEASURES_TABLE);
}
It should be :
// Creating Tables
@Override
public void onCreate(SQLiteDatabase db) {
String CREATE_MEASURES_TABLE = "CREATE TABLE " + TABLE_MEASURES + "("
+ KEY_ID + " INTEGER PRIMARY KEY," + KEY_DATE + " TEXT,"
+ KEY_TIME_HOUR + " INTEGER NOT NULL," + KEY_TIME_MINUTE
+ " INTEGER NOT NULL," + KEY_BE_INTAKE + " REAL NOT NULL,"
+ KEY_GLUCOSE + " REAL NOT NULL," + KEY_BOLUS
+ " REAL NOT NULL," + KEY_BASAL + " REAL NOT NULL" + ")";
db.execSQL(CREATE_MEASURES_TABLE);
}