1

I have an android Service in my app which external apps can bind to. Also, when an app binds to my service I return a Messenger for them to use for communicating with my service. This is kinda what it looks like

public class MyService extends Service {
    private Messenger mMessenger = new Messenger(new MyHandler());

    @Overide
    onBind(Intent intent) {
        return mMessenger.getBinder();
    }
}

One requirement I have is to find out the package name of the app that bound to my Service. But after looking around it almost seems like there's no way to get that. I couldn't find any useful methods either in the Intent used to bind to my service, or in the Messenger used when communicating with my service.

Is there any way to get the package name of the connecting app?

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
George V.M.
  • 757
  • 7
  • 16

0 Answers0