How many ways for an android service to interact with other components in one application

In Android defined by a specific Service , how many methods exist for this Service to communicate with other components (activity, content provider, recipient, other services)?

As far as I know, there are at least 7 methods:

  • StartService
  • AIDL / bindService
  • sendBroadcast
  • startActivity
  • Notification
  • messaging engine
  • Ashmem

Are there any others?

Thanks.

+4
source share
2 answers

Like gunar , you can also use Event Manager .

Most Popular:

The documentation itself explains, but if you need help getting started, let me know.

Regards, Ryan

+1
source

If you want to classify them, I would do it as follows.

  • Communication using intentions
  • Broadcast intents (global and local )
  • Component intentions (start, start service)
  • System notifications
  1. Interprocess communication (IPC) can also be used for the in-process process.
  1. Communication through shared objects.
  • Using Singleton (e.g. applications or other singleton classes)
  • Using the event bus (EventBus, TinyBus , Otto)
+1
source

Source: https://habr.com/ru/post/1491387/


All Articles