I am designing a service that can be used by more than 1 applications. The service currently use accelerometer with some calculation and use sendBroadcast() to send some value to applications that use it.
I've tried to share the code among applications.The result is that when an application calls startService(), an instance of service is created, but when another application calls startService(), another instance of service is created without knowing that the service is already created.
How can I can implement a system such that when no application is running, the (first) application invoke the service. The other (lately started) applications send invocation signal to the service, but nothing happens (because the service has already been started)?