I would like to write an Android application (let's call it 'ZX') which communicate with other apps which are unknown in advance.
ZX doesn't want to communicate with all the other apps. It only wants to communicate with apps approved by the user via a ZX-permission. ZX-permissions can be granted and revoked at any time by the user via one of the ZX's activities.
In order to do that, ZX needs to know for sure which app is trying to communicate with it, and in the case of apps connecting for the first time with ZX it needs to display its name (or something else which uniquely identify it) to the user to ask if it should allow it or not.
Questions:
1) How to identify the calling app?
2) What IPC mechanism is recommended for that?