Yes, you need to implement it using ContentProvider if you want to implement a search.
You can use an existing content provider to retrieve tags associated with the scrap.
you can define a different URL in the form "content: // myexample / note / tag / #" to get all the tags associated with a particular node.
You will need to add another URI, which must be mapped in your URI agreement. let's say something like GET_NOTE_TAGS = 3;
In the getType method of your ContentProvider, return the corresponding mime type. I would suggest that this would be the same as the mime type for tags, since you are returning the same tags.
Then, in your query / update / delete / insert methods, parse the incoming URI so that it matches "content: // myexample / note / tag / #". Then, appropriately fulfill your request in your database or your content and return the tags you want to return.
The scheme "content: // myexample / note / tag / #" is just an example, and you can use multiple URIs within the same ContentProvider.
You also stated that you need to join the tables. this can be done using db.query, and if it is difficult, you can use rawqueries to get data as needed from the database.
achie
source share