Hey I want to create a database with an AUTO_INCREMENT column. But I don\'t know how to parse the value in the method insert. I just don\'t know what to parse to an AUTO_INC
You don't have to parse anything. If the column was created as AUTOINCREMENT, just pass the other values:
db.execSQL("insert into "
+ TABLE_NAME
+ "(contact_id, contact_name, number_type, contact_number, duration, date, current_time, cont) "
+ "values( "+ cId + ", " + cName + ", " + numType + ", "
+ cNum + ", " + dur + ", " + date + ", " + currTime + ", ? )");
By the way, it's always recommended to insert data using the Android's insert method:
ContentValues values = new ContentValues();
values.put("contact_id", cId);
values.put("contact_name", cName);
// etc.
db.insert(TABLE_NAME, null, values);