There is an IPC EventBus option that allows you to send events through IPC. https://github.com/NewtronLabs/IpcEventBus
According to the documentation, all you have to do to get the event is the following:
public class Listener implements IIpcEventBusConnectionListener, IIpcEventBusObserver { public Listener() { String targetApp = "com.packagename"; IIpcEventBusConnector connector = ConnectorFactory.getInstance().buildConnector(context, this, targetApp); connector.startConnection(); } @Override public void onConnected(IIpcEventBusConnector connector) { connector.registerObserver(this); } @Override public void onEvent(IEventIpc event) { Log.d("ipceventbus", "Received event: " + event.getClass()); } @Override public void onDisconnected(IIpcEventBusConnector connector) { } }
And on the other hand, you post the event as follows:
IpcEventBus.getInstance().postEvent(new MyEvent());
I created two applications, and they were able to send events to each other.
J_Strauton
source share