I read about SQLite. I found information about making database in Android but I am wondering about opening existing database written somewhere else. Is there a possibility to open and read database from .sql file which I prepared earlier?
Asked
Active
Viewed 107 times
-1
-
you can use http://sqlitebrowser.org/ – Aditya Vyas-Lakhan Mar 07 '17 at 09:23
3 Answers
1
I guess you could use SQLiteDatabase db = SQLiteDatabase.openDatabase(pathToYourDatabase, null, SQLiteDatabase.OPEN_READWRITE));
Otherwise you would probably need to open/read the .sql file and use it to create the database + data.

Marcos Holgado Molina
- 416
- 3
- 10
1
Perhaps SQLiteDatabase.openOrCreateDatabase(dbfile, null);
is what you want .But only .db
file works.

xiaoyuan
- 423
- 4
- 13
0
Yes, You can open and read from the existing database file if your app has access to the .DB
file. If the .DB
file is in another app memory, you will not be able to access it. But if the .DB
file is on external storage you can open and read from it.

AbhishekB
- 2,111
- 3
- 18
- 23