I've a android library which is called from an App. I want to access App's version from library project. Is it possible at all?
EDIT: I don't control the calling app. I need some way to get calling app's version from library.
If you pass the context information, you should be able to use
PacketManager yourPacket = context.getPackageManager(); One option you have to is get the apps version from your own app itself, and then make it available "manually" to the library by storing it in some sort of shared storage like a WORLD_READABLE file, or on the SDcard or something.
Or perhaps depending on the library, and how much you are able to modify it you could also use some sort of Static object to hold the data for you.