Monday, February 13, 2012

Starting a service from another process or application

I was struggling to figure out the right permissions or steps to start a
service in another application. My need was I have two application where
one application is checking to make sure the user hasn't stopped the first
application. I need to check if it was running and start it if not. I was
checking about every 2 seconds.

The solution is extraordinarily simple; just mark your server as "exported"
in the manifest, e.g.

<service
android:name=".Monitor"
android:exported="true" />

Hard to discover the answer but easy to implement!

1 comment:

  1. Great blog,I follow now,please follow me back!Un saludo !
    Vos codes inkazee du jour by Angela

    Si vous aimez jouer sur les sites Enovaa, Inkazee, Solytary, vous cherchez sûrement à partager vos codes chaque jour

    ReplyDelete