I have library project which referred by many applications. Now I got a new requirement in which I need to change the function in this library project. I need to pass a variable to my web service depending on by which application this function has been called. So need to know the name of the current application in that library project. I know I can do it by passing Context but I am looking for the option without passing Context. Because otherwise I dont know how many applications I will have to change.
Share
As far as I know.. When a method in your common library is called, the method itself can not know which application is calling it. Passing a parameter to identify the application is the best option you have.
Depending on the functionality and the time when you call your methods.. You could get the application which is running in the foreground. But if you have a service running or something less straight forward, this will be again a hard thing to do.