0

I'm an Android newbie. I'm trying to send and receive messages between process. One thing which I'm aware of is communicating via binder calls by implementing a Service. The other message transferring mechanism which I've seen so far is

  1. Broadcast (Not reliable though) - which can be missed
  2. Event bus (Not sure IPC is possible with greenrobot's event bus - this SO link says it's not possible and suggested for alternatives
  3. Registering a ContentObserver so that I can update my content at one process and the other process can get notified of the content change (Not sure this is reliable)

All I mean by reliable is that it can be missed at rare cases. Is there any alternative reliable and ordered (delivered in the same order in which it's published) - message exchanging mechanism between processes in Android?

EDIT: Though there are many ways discussed in this SO Link I would like to maintain the message order and guaranteed delivery of message.

Tom Taylor
  • 3,344
  • 2
  • 38
  • 63
  • Possible duplicate of [What are the IPC mechanisms available in the Android OS?](https://stackoverflow.com/q/5740324/608639) – jww Jun 11 '19 at 15:04
  • I broadcast was working fine for me – Saran Sankaran Jun 11 '19 at 15:05
  • 1
    #2 is not an option, insofar as an inter-process event bus is itself using IPC, which gets you back to where you started. #1 and #3 should be as reliable as a bound service or anything else (e.g., `ResultReceiver`). Android is a consumer-grade operating system, and so none of these are mission-critical-level reliable, but they are generally good enough for most cases. If you need more than that, have only one process, or switch operating systems to one where you have far greater control (e.g., embedded Linux). – CommonsWare Jun 11 '19 at 15:11

0 Answers0