The design is like Master-follower app in android. Where when follower app comes up it needs to start a service in the Master app [Not the master app itself, no Activity just service]. And get results from the master service.
I have something like this :
<!-- Android provider backend service -->
<service android:name="com.abc.shop.ABCProductService" android:exported="true">
<intent-filter>
<action android:name="com.abc.shop.ABCProductService" />
</intent-filter>
</service>
Now I can call something like from inside an Activity in the follower app.
Intent intent = new Intent("com.abc.shop.ABCProductService");
this.startService(intent);
In service implementation I return STICKY, so as the service is not destroyed.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
....//some init stuff
return START_STICKY;
}
I have two questions here :
The service does not start using the above code. I am certain about it as when I try to find the service in the running service it is not there.
I do not want any other app to be able to call this service except my Follower app, which would be signed by the same author. Any way to achieve this security/authentication?
Forgive my novice question, I tried to find the solution but could find no good solution.
Thanks Varun