versionCode vs versionName in Android Application

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

versionCode - versionCode vs versionName

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: 332. is the versionName in the following APKMirror screenshot of the Facebook app

versionName - versionCode vs versionName

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.

Related Articles:

  1. What is android.permission.DISABLE_KEYGUARD Permission in Android Apps?
  2. What is AAB? Difference between AAB and APK
  3. What is Android.PUA.DebugKey? How to Fix it?
Appreciate the work by Sharing the article on Social media
Abhishek Verma

Abhishek Verma

Abhishek Verma is a tech enthusiast and freelance tech journalist. He has been writing about technology for 5 years. He is passionate about every aspect of technology, especially Android. Abhishek’s articles have been referred by India Today, 360Gadgets, Times of India, MacRumors, AndroidPolice, AndroidAuthority, BGR, Zee News, and many more.

Articles: 310

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *