I have a Content Provider for a SQLite database that has multiple tables and uses URIs like so:
Uri.parse("content://" + AUTHORITY + "/" + TABLE_NAME);
This seems to be the standard pattern, with 1 URI to 1 database table, along with 1 CONTENT_TYPE for all rows, and 1 for a single row.
However, I have a need to have URIs for subsets of table data. It doesn’t make sense to me currently to add a ton of additional tables to my database. It sure seems like the content provider is designed to handle this, I just can’t see it. Basically I want to have a URI that points to a query instead of a table. Hope that makes sense.
You just need to add wherever new URIs needed by your application then modify the query method of your content provider: