Senthil Kumar
Senthil Kumar

Reputation: 81

Sqlite DB with Android some basic questions

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?

Upvotes: 8

Views: 435

Answers (2)

waqaslam
waqaslam

Reputation: 68167

  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 :)

Upvotes: 5

omkar.ghaisas
omkar.ghaisas

Reputation: 245

Ok.. I will try and answer most of your questions.. 1) Is the Data secure - Android stores app specific data in its app specific location and access is provided to only that application. So, we can say, its pretty secure, because no other app can read your app's data, unless access is provided to 2 applications having a same package name.

2) Location where db is stored - its under data\data\databases\packagename*.db 3) The data will remain on phone, unless the app is uninstalled / android crashes, in which case you would have to clear the phone cache and app cache, thus removing everything from android's inertnal phone memory.

Upvotes: 1

Related Questions