Search code examples
androidandroid-sqlitelocal-storagestorageandroid-external-storage

App specific storage or sq lite database for reminder app?


I am trying to develop a reminder app in android studio. The user can create an appointment which will be shown in a recycler view. Every created appointment has a name and a priority. The user can choose if the appointment should also have an alarm. Later on I want to implement the possibility to attach an audio recording, an image from the gallery or a document from the device to the appointment, and the possibility to sort the appointment by date or search by name.

Now to my question, I want to save the appointments locally on my device, but I don’t know what type of data storage is better for my app. I already searched on google, but couldn’t find any concrete answer. After looking through the internet I think the best two options for me are sq lite database or app specific storage in the external storage. Can somebody please help me and tell me which one is best and why for my specific situation?


Solution

  • Use ROOM db it is flexible to store data objects and modify them with simple and clean code, on the other hand sqlite needs to write a lot of boiler plate code and even developers recommends to use ROOM DB over sqlite or shared preferences, you can run simple queries and fetch data from the database using ROOM Database, you can also write/read files using FileProviders but it requires user local storage permission which may be denied by few.