How do I get the build version of an application?

Asked 1 years ago, Updated 1 years ago, 123 views

I want to know the build version of the re-app So I want to print it out on the UI Do I have to touch the Android manifest file?

android android-manifest android-emulator

2022-09-22 22:35

1 Answers

PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
String version = pInfo.versionName;


int verCode = pInfo.versionCode;

VerCode is the build version~


2022-09-22 22:35

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.