title: Android Content Provider and Many-to-Many DB relationship
body: <p>I have a simple Notes app which is similar in functionality to the Android NotePad sample. One addition is that every note can have Tags. A <code>Note</code> can have several <code>Tag</code>s and a <code>Tag</code> can belong to several <code>Note</code>s - thus making this a many-to-many relationship.</p>
  
  <p>I have completed the DB Design using Foreign Keys and a Mapping Table. Now, I wish my app to plug into the Android Search Framework, which necessitates the use of a <code>ContentProvider</code> to expose my data.</p>
  
  <p>Are there any best practices to be followed for this scenario? I did find a few related questions on SO, but most of them dealt with one-to-many relationships (<a href="https://stackoverflow.com/q/3814005/570930">this one</a> for example). I did conclude from these questions that it is best to have a single <code>ContentProvider</code> per DB, and then use the Matcher concept to resolve multiple tables within the DB. That still leaves other questions open.</p>
  
  <ol>
  <li><p>Given a <code>Note ID</code>, I would like to return all the tags associated with that Note. How do I go about setting up the <code>ContentUri</code> for such a case? Neither of <code>"content://myexample/note/#"</code> and <code>"content://myexample/tag/#"</code> would serve the purpose.</p></li>
  <li><p>None of the 6 <code>ContentProvider</code> methods which I override would suit such a purpose, would they? I can of course, introduce a new method, but that would not be understood by the consumers of my <code>ContentProvider</code>.</p></li>
  </ol>
  
  <p>Thanks in advance for your suggestions.</p>