title: how do i start (and bind) a remote service in android that is implemented in another app (different package)?
body: <p>i'm a bit stuck with remote services in android. thing is i implemented a remote service in package "a.b.c" and i want other applications to be able to access this service. i got rid of the whole crappy aidl-stuff and designed the "interface" of the service to work via broadcasted intents. works fine so far...</p>
  
  <p>problem is: how do i get a <code>different</code> application (different package, different project, maybe even a different developer, ...) to start/stop the service?</p>
  
  <pre><code>package d.e.f;
  
  import a.b.c.*;
  
  public class main extends Activity {
      protected ImyService myService;
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.main);
  
          Intent intent = new Intent(ImyService.class.getName());
          bindService(intent, sConnection, Context.BIND_AUTO_CREATE);
      }
  
      protected ServiceConnection sConnection = new ServiceConnection() {
          public void onServiceConnected(ComponentName className, IBinder binder) {
              wlService = ImyService.Stub.asInterface(binder);
              ServiceConnected = true;
              Toast.makeText(main.this, "service connected", Toast.LENGTH_SHORT).show();
          }
  
          public void onServiceDisconnected(ComponentName className) {
              wlService = null;
              ServiceConnected = false;
              Toast.makeText(main.this, "service disconnected", Toast.LENGTH_SHORT).show();
          }
      };
  }
  </code></pre>
  
  <p>this will crash my app immediately on startup. what did i do wrong? how will i get this to work?</p>
  
  <p>once it's running, commands and data will be passed via broadcasts. so that should be no real problem...</p>