I'm using SQLite to create a database table for my app. I've searched online but haven't found the answer yet: Do I need to create a database first or is there a default database for each app?
I've written the following DBHelper class. It's in a separate file. How Do I call it when the app starts?
public class DataBaseHelper extends SQLiteOpenHelper{
final String CREAT_TABLE = "CREATE TABLE IF NOT EXIST `employee` ("+
"`id` int(11) NOT NULL AUTO_INCREMENT,"+
"`firstName` varchar(30) NOT NULL,"+
"`lastName` varchar(30) NOT NULL,"+
"PRIMARY KEY (`id`)"+
") ;";
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(CREAT_TABLE);
}
}