Well i want to add some features on my app. What i want is to put a search button there, and i know in order to do that i have to put my text on a database to use sql for querying. However is there a disadvantage of using sqlite on android? For example if i have to store large file in there? or if one user delete the application i created will the database remains in their phone? And also what is the maximum size i can use on sqlite on android? Is there any other alternative to use rather than using database? Thanks..
4 Answers
Well I am not sure about the database but generally external storage data is never deleted unless the user deletes it himself. Although in older versions of android, data used to be deleted on app uninstall.
I am not sure about disadvantages, but apart from SQLite, there are 3 more data storage options in Android. One is shared preferences, but that only caters primitive data types, and is deleted on app uninstall. Second is file storage on internal memory, which also gets deleted on app uninstall. And third is file storage on external memory, which is not deleted on app uninstall, but is open for access by any other application or by a computer if the storage is mounted on a computer.
SQLite data is safe and private to the application and I believe is a good storage method. Its size limit is standard from SQLite, check SQLite limits here.

- 246
- 1
- 4
- 13
Its seems to the SQLite is good solution for your. If you planning to search texts in DB you can use FTS feature. I think its capabilities for supporting large files exceeds modern HW caps :) . Sqlite database is simple file, thus you can control whether to save it on user device (putting db file on sdcard or so (that is highly not recommended)) or not save (putting db file into app local storage).
If you describe little bit more your app, i can suggest some alternatives.

- 2,217
- 19
- 31
-
ahm well i created an Informative app where there is some hotel and restaurant you can see with listview. But they are so many of them so scrolling them to the bottom is a bit annoying for me. so I decided to have a search button where i can search the name of the hotel i want.. – thenewbie Aug 04 '12 at 07:35
I think there is no disadvantage is there using of sqlite with your application.But one think you do not forget you have to do all database operations in background thread only.If you run in main thread the UI will freeze while dealing with large data.
It is also possible to delete your application data from SDCard if you create file using method getExternalStorageDirectory()
.see below link for creating files using that
Android how to use Environment.getExternalStorageDirectory()
-
Oh i see.. If im correct using SD card is for rooted android phone only right?? Thanks.. Now i have to study threading.. i hope its easy ^_^ Thanks again – thenewbie Aug 04 '12 at 07:32
Actually, I believe this is one of the things Sqlite is good for. Sqlite, being a 1 file solution to databasing, allows you to clone and deploy easily. As for the deletion on uninstall and size limit, I can't imagine why it would be treated differently from any other file (since it is just a file)

- 8,747
- 4
- 40
- 60