I have two applications. One app has the Activity and another one is a background service.
I can able to access the service app from my activity app using implicit i
First add a class like this:
package com.test.context; //For example
public class MyContext extends Application
{
//Here you define the attributes to share through the application
// with setters and getters
}
and in the AndroidManifest.xml, add the path of the class, in the example is com.test.context so:
<application android:name="com.test.context.MyContext"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
Then in your code you can do some like this:
MyContext ctx = (MyContext)getApplication();
And you will be able to share data in all the app, btw activities and services, i did it this way in a Tasker , and works fine.
Why do you want to communicate through intent while there is a perfectly working binder protocol.
http://developer.android.com/guide/topics/fundamentals/bound-services.html
If an activity starts a service with 'bindService()' then the service will run until the activity calls 'unbindService()'.