In principle, I am more than confident that everyone will say (who is in the subject) that 1 will be better than a few, but I would like to know the general opinion, maybe someone will have their own useful, sound arguments on this subject ...
1 answer
- It all depends on the specific task, the logic of the problem, if you like. If the task logic requires that you have 1 cursor returning values ​​from several databases / tables - so be it.
- Here, all the same important question different database or different tables. I would not advise combining 2 different databases into one
ContentProvider- a cross-border query is quite expensive in terms of resource consumption, but for a different table please. In terms of SQL, this is allinner/left/right join- all DBMS are sharpened for this. - If the logic requires combining several databases (not tables, namely, databases) into one
ContentProvider, then this, in my opinion, is an architectural flaw — either the database is incorrectly designed, or the task is some kind of “left”. ContentProviderhas another important task, namely, publishing the internal resources of the database program to the outside. For example, it is impossible to directly reach the SMS / MMS database using standard means, but please use theContentProvider. Hence the conclusion. If in the future some databases / tables / resources are planned to be “stuck out”, then there is noContentProviderwithoutContentProvider(you need a flag in the manifestexported=true)
|