title: Retrieving the component name of a service defined in another Xamarin application
body: <p>I'm currently implementing an Android Service which is to be consumed by another application of a partner company. They implement the frontend GUI, we do the business logic inside the Service.</p>
  
  <p>The Service is declared like this:</p>
  
  <pre><code>[Service]
  [IntentFilter(new[] { "PsiServiceHost" })]
  public class PsiServiceHost : Service
  {
  ...
  }
  </code></pre>
  
  <p>The consuming application (optionally) starts the service and connects to it using this Intent:</p>
  
  <pre><code>serviceIntent = new Intent("PsiServiceHost");
  </code></pre>
  
  <p>Starting the service using ...</p>
  
  <pre><code>ApplicationContext.StartService(serviceIntent);
  </code></pre>
  
  <p>... results in the following log output:</p>
  
  <blockquote>
    <p>08-16 10:38:17.182  3429  3429 W ContextImpl: Implicit intents with
    startService are not safe: Intent { act=PsiServiceHost }
    android.content.ContextWrapper.startService:581
    md5db25c5914f35662b07cd28205cc94074.MainActivity.n_onCreate:-2
    md5db25c5914f35662b07cd28205cc94074.MainActivity.onCreate:29</p>
  </blockquote>
  
  <p>According to <a href="https://stackoverflow.com/a/27308675/88513">this answer on SO</a>, starting Services using implicit intents is no longer possible even though it works fine in my case on Android 6.0 running on the Emulator.</p>
  
  <p>Anyway, just to be safe I would like to use the recommended approach of constructing my Intent using a ComponentName. This would be no problem for code residing in the same project as the service as I could do this and be done with it:</p>
  
  <pre><code>Java.Lang.Class.FromType(typeof(PsiServiceHost)).CanonicalName
  </code></pre>
  
  <p>But unless the result from the above line of can be considered to be stable and safe to be included as string in another App, I don't know how provide the consuming App with the component Name of our Service.</p>