Navdroid
Navdroid

Reputation: 1549

How to manually create a database file in android which could be used with SQLite?

I have to create a database with 3 tables manually and include that file to my android app. Is this possible. how?

Upvotes: 1

Views: 2325

Answers (2)

Noby
Noby

Reputation: 6602

Try this...

Open terminal and follow the commands.

$ adb shell
# cd data
# cd data
# cd com.testapp  // your apps package.
# mkdir databases
# cd databases
# sqlite3
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

here you can create tables and can use as normal sql console.

Upvotes: 1

Caner
Caner

Reputation: 59168

Yes, you can create the database manually with SQLite browser. Then you can copy it to emulator/device.

Upvotes: 3

Related Questions