I am kind of stuck in dilemma, I am making an application which consist of multiple tables/entities and I am using Content Provider to manage my sql data. Almost every table in db has a relation with other table.
Now I am really confused whether I should make a single content provider, stuff it with 9,10 tables and use it. Or should I make a separate content provider for every single table and use it.
I can handle join queries between tables in both ways as well. Can anyone give me pros and cons for both approaches? and guide me in the right direction ?
Any kind of help, would be highly appreciated.
If the tables relate to each other and presumably you would like to do joins then you should do one content provider and not multiple. I assume if the tables relate then you will be wanting to do joins on data or at the very least enforce foreign key constraints.
Also for doing joins the best way. In my opinion to do them is to create a view. Treat it kinda like a table. You can query it like a table also. Just my advice. If your still interested in this I can go into more detail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With