Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sqlite DB with Android some basic questions

Tags:

android

sqlite

I want to use an SQLite database in Android. I have few questions:

  1. Is there a maximum size of database?
  2. How secure is the data?
  3. Where is the database stored?
  4. How long will the data will remain on the phone?
like image 663
Senthil Kumar Avatar asked Apr 05 '12 13:04

Senthil Kumar


People also ask

What is the use of SQLite database in Android?

SQLite Database is an open-source database provided in Android which is used to store data inside the user's device in the form of a Text file. We can perform so many operations on this data such as adding new data, updating, reading, and deleting this data.

What is SQLite in Android with example?

Android SQLite is a very lightweight database which comes with Android OS. Android SQLite combines a clean SQL interface with a very small memory footprint and decent speed. For Android, SQLite is “baked into” the Android runtime, so every Android application can create its own SQLite databases.

What data type does SQLite support Android?

Date and Time Datatype SQLite does not have a storage class set aside for storing dates and/or times. Instead, the built-in Date And Time Functions of SQLite are capable of storing dates and times as TEXT, REAL, or INTEGER values: TEXT as ISO8601 strings ("YYYY-MM-DD HH:MM:SS. SSS").

What is SQLite in Android and its features?

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.


1 Answers

  1. Theoretically, it is calculated as 35 trillion bytes which should be way more than enough for your application because there's always limit to phone's memory. In short, you shouldn't be asking this question for a mobile app :)
  2. If your phone is not rooted then the database stored in phone's internal memory is residing in the most secure storage area. Rooted phone does not offer any security to any file with in internal or external storage medium
  3. If you don't provide any path, then the default/ideal location is phone's internal memory. And the file is placed inside data/data/package_name/database_file. This can be observed on emulator by exploring DDMS -> FileExplorer. If you save the file on other storage mediums, like sd-card, then of course it means you know where you are saving it :)
  4. As long as your phone is functional and you don't wipe the app's cache, uninstall the app or do factory reset. No guarantees if you burn, crush, or spill water on your phone :)
like image 191
waqaslam Avatar answered Sep 27 '22 17:09

waqaslam