This is a sample manifest. Is it possible to access the attribute versionCode and versionName from Java? How?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example"
android:versionCode="1"
android:versionName="1.0" >
[...]
</manifest>
Yep:
context.getPackageManager().getPackageInfo (context.getPackageName(), 0).versionName;
context.getPackageManager().getPackageInfo (context.getPackageName(), 0).versionCode;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With