Android service in the library

I created a library with a service in which I want to be able to communicate with more than one apk.

This is in the library manifest

<service class=".service.MyService" android:permission="com.wissen.permission.MY_SERVICE_PERMISSION"> <intent-filter> <action android:value="com.wissen.testApp.service.MY_SERVICE" /> </intent-filter> </service> 

and this is in my manifest apk

 <uses-permission android:name="com.wissen.permission.MY_SERVICE_PERMISSION"></uses-permission> 

and of course I added lib to apk. I keep getting the service not found (warning). What am I doing wrong.

I will tie it this way

 bindService(new Intent("com.wissen.testApp.service.MY_SERVICE"), conn, Context.BIND_AUTO_CREATE); 

Decision:
Now I have created help for these purposes and its performance.

+4
android service
source share
3 answers

Your service must be a remote service. You must create * .aidl (the interface to your service) and run it in your own process. You can read about it here: Android Interface Definition Language (AIDL)

+1
source share

The service should be specified in the manifest for your application, and not in the library.

+24
source share

I created an assistant for them and its performance now.

0
source share

All Articles