Hello i am following this tutorial Using your own SQLite database in Android applications
Now i don’t understand how is save in first place created database. Here is the code how sqlite is taken from resources folder:
InputStream myInput = myContext.getAssets().open(DB_NAME);
So where to keep in first place my sqlite as if i copy in resources folder i get compiler error:
invalid resource directory name
Thanks.
As what i did in one of my project, copy your database file in
rawfolder and get itsInputStreamas below:now copy myInput stream contents to a cache directory in order to create a copy of your database file.
Further you may use that database file with
SQLiteDatabase.openDatabaseto getSQLiteDatabaseobject and do your sql magic