Using an exported service in another app on Android -
i have main app includes service , second app wants make use of service.
the main app has in manifest (not inside activity):
<service android:name="com.example.foo.xmppservice" android:exported="true" android:process="xmppservice" />
in second app try bind it:
intent intent = new intent(); intent.setclassname("com.example.foo", "com.example.foo.xmppservice"); bindservice(intent, mconnection, context.bind_auto_create);
but error:
unable start activity componentinfo{com.example.app2/com.example.app2.mainactivity}: java.lang.securityexception: not allowed bind service intent { cmp=com.example.foo/.xmppservice }
so i'm wondering why not allowed, while set "exported" true.
you start android:process
lowercase letter, documentation:
if process name begins lowercase character, service run in global process of name, provided has permission so. allows components in different applications share process, reducing resource usage.
the service part of application if leave tag alone. start messing it, create process itself. global process run system user , requires signed platform certificate.
Comments
Post a Comment