This article is cited inter-process communication between Android and Android thread common means of communication, but please forgive me, or to achieve specific principles can be found in other blog.
Android IPC
- Intent way communication Bundle
- Broadcast mode
- File sharing the way
- AIDL way (based on Binder)
- Messenger mode (AIDL + Handler Message way)
- ContentProvider way
- Socket (network)
Android Inter-thread communication
Room (1) refers to a narrow thread communication: a communication sub-thread of the main thread. There are four common ways are as follows:
- Handler way
- runOnUiThread way
- View.post (Runnable r) mode
- AsyncTask way
(2) between the broad-thread communication means: interactive, communications applications within the four components of each class. Including but not limited to, the following manner:
- Global variables (note concurrent processing - single embodiment, volatile)
- Callback Interface
- EventBus
- RxJava achieve similar functionality EventBus