I have an eclipse project with two library projects enabled. These projects have their manifest files with version information. Now I want to read the version number from these library projects as part of my main project. Information cannot be read by calling PackageManager:
Because the library is not an installed application. But what is the right way to get this information?
For example: I included the zxing Android project as a library project. This project has the following version information in the manifest file:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.google.zxing.client.android" android:installLocation="auto" android:versionCode="88" android:versionName="4.3.2" >
I want to read versionCode and versionName. If I use packageManager, as in the above code, I will get versionCode "93" and versionName "4.5".
source share