sree_iphonedev
sree_iphonedev

Reputation: 3534

How and where to add sqlite(.db) file in to an android project

I am new to Android. Now, I am trying to work with database. I got many tutorials for manipulating Sqlite database operations. But my doubt is that where should I add the .db file in to the application. In package explorer window of IDE, under which folder group I need to add the .db file? I hope you understand my question.

Thanks in advance.

Upvotes: 32

Views: 36624

Answers (1)

MAC
MAC

Reputation: 15847

If you already have .db file then put that file in assets folder or raw folder

Then you have to copy that file at path /your.package.name/data/data directory for further use.

Otherwise you can create new database using code...

see this example....

Upvotes: 26

Related Questions