I have a service in an application, and I can reach this service from different applications. And when applications are tried to bind this service I want to know which appli
You can use the following to determine the calling application.
String callingApp = context.getPackageManager().getNameForUid(Binder.getCallingUid());
It's important to note the JavaDoc for getCallingUid() which says:
Return the Linux uid assigned to the process that sent you the current transaction that is being processed. This uid can be used with higher-level system services to determine its identity and check permissions. If the current thread is not currently executing an incoming transaction, then its own uid is returned.