How to discover and communicate with certain interfaces in external applications
<p>My application is searching for data, given various filtering parameters. This data is acquired from multiple sources (i.e. multiple sites over Internet). I want other developers to be able to implement <strong>their own data sources</strong>, so they could "plug" them into my application <strong>without</strong> any action on my part.</p>

<p>What is the best way to achieve that? In particular:</p>

<ol>
<li>What should the external developers do to make their implementations visible to my process?</li>
<li>How do I discover such external implementations?</li>
<li>Once discovered, what can I use as an identifier for each of these implementations?</li>
<li>How to communicate with various "methods" of the external implementation.</li>
</ol>

<p>My best guess is to use services:</p>

<ol>
<li>Have external developers set up their service with intent-filter with <em>a specified URI</em>.</li>
<li>Use <a href="http://developer.android.com/reference/android/content/pm/PackageManager.html" rel="nofollow">PackageManager</a>#queryIntentServices method to list all services matching <em>a specified URI</em>.</li>
<li>Use their package name as identifiers, so I can fire up intents directly at that package.</li>
<li>Believe that external developers listen and properly respond to all intents specified in my docs. I will pass them either PendingIntent or Messenger objects to get the results back.</li>
</ol>

<p>I haven't yet tried it and I am a beginner in Android. Is this the proper way?</p>
