I want to create database in android without usin the SQLiteOpenHelper Class. I want to create it using the SQLiteDatabase class.I am doing it in this way–
SQLiteDatabase sqldb;
String path="data/data/mypackagename/sample.db"
public void CreateDatabase(){
sqldb.openOrCreateDatabase(path, null);
}
While executing it’s throwing an exception that ‘unable to open the databse file’. Please help me out in creating the database file using the SQLiteDatabase class.
You can not give path of your database like this …here is the code for it..
here is the link that you can refer..http://www.higherpass.com/Android/Tutorials/Accessing-Data-With-Android-Cursors/