Answer the question
In order to leave comments, you need to log in
Database storage?
Usually, when creating a database, the path where it is stored is "data/data/YOUR_PACKET_NAME/databases/YOU_PROJECT_TITLE". The question is: Is it even possible to add your db file directly to this path in the project files, thereby avoiding the creation of a database inside the application. If so, why doesn't anyone do it?
PS I have seen implementations with adding a db file to the assets folder, after which, again, the database created inside the application was overwritten using the file added to the database. But I'm interested in adding my own db file directly to the above path. Thank you.
Answer the question
In order to leave comments, you need to log in
Keeping the database on the client side is a pleasure.
First, you will need to ask the user for permission to read / write data from the device. After this request, the user will delete the application with a 99% probability, unless it is a super-necessary application without analogues or the application's functionality provides for working with files. Well, if you do not provide permission, then your application simply will not work. And it will also be removed.
Secondly, the database is used not only for reading, but also for writing. What will happen to the saved data if you roll out a new version of the application?
A real example, now in one of my applications, the local database contains IDs of localized strings (translated into several languages), so after each new string is added to the resource file, all IDs disappear, and all values in the database become irrelevant. I have to do a data migration after every update.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question