Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: use SQLite database on SD Card (not using internal Android Data Store at all)

Tags:

android

sqlite

Can somebody please give me some links / tutorials to using SQLite file thatis stored on a SD card? Not implementing the OpenHandler.

/SD CARD//info.db

I want to use an external SQlite database file (not use Android internal data store) because I want to frequently update the database file to provide more up to date information on info.db.

Thank you.

like image 328
rvpals Avatar asked Dec 13 '10 20:12

rvpals


People also ask

Where SQLite database is stored in Android?

The Android SDK provides dedicated APIs that allow developers to use SQLite databases in their applications. The SQLite files are generally stored on the internal storage under /data/data/<packageName>/databases.

What is SQLite Sdcard storage DB?

What is SQLite Sdcard storage DB? SQLite is an open-source relational database i.e. used to perform database operations on android devices such as storing, manipulating or retrieving persistent data from the database.

Does SQLite load database into memory?

An SQLite database is normally stored in a single ordinary disk file. However, in certain circumstances, the database might be stored in memory. The most common way to force an SQLite database to exist purely in memory is to open the database using the special filename ":memory:".

Is SQLite deprecated in Android?

In which case, does that mean that SQLLite is deprecated in Android? No.


1 Answers

Have you tried using SQLiteDatabase.openOrCreateDatabase(String, SQLiteDatabase.CursorFactory)? You can simply pass "/sdcard/info.db" as the first and null as the second parameter.

like image 131
mreichelt Avatar answered Sep 24 '22 00:09

mreichelt