Possible Duplicate:
How to retrieve the android sdk version?
How does one retrieve the version info of an Android library programmatically?
I’ve written an application where I put some of the logic in a library. In my help-about box, I’d like to show the version number of the actual app, and the underlying library it is using.
This post
indicates that it is not possible as the library manifest info is lost upon compilation. However, the post (towards the end) also hints at the idea that it might soon become possible (post is from 2010).
While some amount of manifest merging is apparently possible today, it won’t help you a bit, because there is no place in the system where the version number of library projects would be recorded in the manifest, let alone in the OS some place that you could reach via the SDK.
I’d just put a string resource in the library and use that (
R.string.my_super_library_versionor some such).