2

I am working in a project where different components in Android source tree need to communicate. For example, the accessibility service need to sends a request to ImageView class to notify when ever a new image view is instantiated.

I want to know some ways to handle theses scenarios, my broadcast receiver did not work. And it does not work without a context. Can you guys suggest some other approaches? If I implement memory file how I can handle notifications that some requests have been made?

P basak
  • 4,874
  • 11
  • 40
  • 63

1 Answers1

1

Most Android internal components that run under the dalvik (or ART) communicate with each other through AIDL's. This mechanism will provide a very raw mechanism to pass data between apps with different processes.
AIDL also support creation of a callback - you will need to create another parcelable object as your callback interface and set it as a return value (Guide).

Here you can find a good example of the accessibility service implemanting the AIDL IPC mechanism.

Community
  • 1
  • 1
Nir Duan
  • 6,164
  • 4
  • 24
  • 38