Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Store Android SQLite

Tags:

android

sqlite

I have a sqlite database that gonna be filled from a webservice with intially 1000 record , then i will insert more record in it each time i need to do. my question is where to store the sqlite database in device in a way to keep inserting ( either in internal or external memory) i.e if i store the database in internal memory and when a internal memory get filled i can move it to external and keep inserting OR if i store it in the external storage and the external storage get filled and there is an available space in internal i can move to internal and keep inserting data .. i am very confused about this can you help me any suggestion or links please

like image 553
confucius Avatar asked Feb 04 '12 12:02

confucius


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 Android SQLite?

SQLite is a opensource SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC,ODBC e.t.c.


1 Answers

Following Answer I am giving on the based on my personal experience.

  • First Suggestion ( Internal/Phone Memory )

    When you are storing database in Internal Memory, then for the Performance it is very good. Because your Application will be installed in the Internal Memory, so while inserting 1000 Records and other record ,for the application it would be more easier to access the database. Application's performance will be very nice. But when it comes to Memory limitations, when Internal Memory will get filled more than enough then your device's performance will be down. So Internal Memory is best till medium level database.

  • Second Suggestion ( External Memory, SD Card )

    When you are storing database in external Memory like SD Card, then for performance , application performance’s will be bit slower than Internal Memory. However this won't be significant for medium level database. When there is very few data then performance will be same in both the cases. Now when you are using External Memory, then you have large size of data storing. I do not think it will never get filled fully . But in case of large number of records performance will be down. Sometimes it may be possible that application crashes.

like image 161
Lucifer Avatar answered Oct 04 '22 12:10

Lucifer