If you have ever been into Android app development, you must have seen versionCode and versionName. AndroidManifest.xml file of every Android application contains two properties named versionCode and versionName.
In this article, we will understand the meaning of both version Code and versionName individually. After that, I will tell the difference between versionCode and versionName. We will do a versionCode vs versionName comparison and show you the differences.
What is versionCode in AndroidManifest.xml?
versionCode is a positive integer that serves as an internal version number. versionCode is a number that is solely used to identify whether one version is more current than another, with larger numbers signifying more recent versions. This is not the version number displayed to users; that number is determined by the versionName option, which is described further down. The Android system utilizes the versionCode value to defend against downgrades by prohibiting users from instigating them.
The versionCode value is used by the Android system to prevent downgrades by prohibiting users from installing an APK with a lower versionCode than the version presently loaded on their device.
Because the value is a positive integer, it may be evaluated programmatically by other apps, for example, to check for an upgrade or downgrade relationship. You can change the value to whatever positive integer you wish, but make sure that each subsequent version of your program uses a larger amount. You cannot submit an APK to the Play Store with a versionCode that has already been used for a prior version.
Example: 286414570 is the versionCode in the following APKMirror screenshot of the Facebook app
Note: The maximum value allowed by Google Play for versionCode is 2100000000.
What is versionName in AndroidManifest.xml?
versionName is a string that is shown to users as the version number. This option can be provided as a raw string or as a string resource reference. Because the value is a string, you may define the app version as a [major].[minor].[patch/point] string or any other form of absolute or relative version identification. The versionName has no other role except to be presented to users.
Example: 3188.8.131.52.111 is the versionName in the following APKMirror screenshot of the Facebook app
versionCode vs versionName (Difference)
|versionCode must be an integer||The string value that reflects the application code’s release version as it should be shown to users.|
|Google Play Store determine the version of the application based on the versionCode||Because the value is a string, you may define the app version as a [major].[minor].[patch/point] string or any other form of absolute or relative version identification.|
|New updates are checked using versionCode||The versionName has no use other than to be displayed to users.|
|If you release a new version of your app, the versionCode should begin with “1” and grow by one.|
|When the versionCode changes, the Play Store will notify the user of the update.|
Follow us on Twitter for the latest news and updates regarding Android and Google. Thanks for reading the article.