I can’t comment on the performance benefits, but I always try to work on the principle of "good practice" (or "best") for any access to any data sources (text files, databases or something else).
Looking at things in general (and not Android), the decisions that need to be made when deciding on the access level come down to the operation being performed, as well as to any external influences.
Two examples that I can think of ...
- If the external process may be responsible for storing data - in this case it can “open” the data source in such a way that it blocks everything except “read” access to any other process during the maintenance phase. In this case, your code will be denied access if you request read / write access when this is not necessary.
- Risk of compromising data integrity - hacks into systems from the outside world can be achieved through a security hole using internal code that has read and write access to data when it is really needed only for read access.
OK, these points may or may not be related to Android (especially if your data source is specific to your application), but, as I said, I try to look at things in general and use the “best practice” approach. If I do not need to "write" access, I do not ask for it.
Squonk
source share