What is the difference or what is it for?
versionCode 1
versionName "1.0"
What is the difference or what is it for?
versionCode 1
versionName "1.0"
The versionCode is a number that is used to determine if one version is more recent than another. This number is not shown to users but it is used to define the version number within the Play Store.
The versionName its sole purpose is to show number of version of the application to users.
When you upload applications, in the Play Store development console you can see the versionCode number and in parentheses the versionName , the versionCode is very important because through this number you can manage the versions of applications within the Play Store, the versionName , is only a description. You can have the same versionName but never the same versionCode per application.
Previously, only these indicators could be defined within the file AndroidManifest.xml
:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.puisorulmeu.drag"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="3"
android:versionName="1.2" >
Currently they can be defined within the file build.gradle
of your application, and overwrite the values defined in AndroidManifest.xml
...
...
android {
...
...
versionCode 3
versionName '1.2'
}
...
Free translation by me:
The internal version number. This number is only used to determine if one version is more recent than another, with higher numbers indicating the most recent versions. This is not the version number shown to users; that number is set by the attribute versonName. The value must be an integer, such as "100". You can define it as you want, as long as each successive version has a larger number. [...]
The name of the version shown to users. This attribute can be established directly to a string of characters, or as a reference to a string resource. The character string has no other purpose than to be shown to the users. The versionCode attribute stores the significant version number used internally.
From this it can be interpreted that versionName
is something that is only shown to the users, but it does not serve to compare or determine which version is more recent. For that, the attribute that matters is versionCode. For each new version of your product you must increase the latter and everything will work as expected.
With information from versionCode vs versionName in Android Manifest
Version code: internal code identifier. does not allow decimals ie whole numbers.
Things to keep in mind, when you post an apk to the store, and then later you want to update it, the version code must be higher than the one that is already published in the store.
versionName: is the version that will be shown on the google play tab.
normally using structure 1.0.0
Within google play developer
in the section estadísticas
, only the current installations are shown, referring only to version code
.
To be able to know that versión name
refers, I recommend putting the same value in both, eliminating the .
in version code
for example version 1.5.3 = 153 when you get to 2.0.3 = 203, in statistics if you see something version 167
you'll know it refers to 1.6.7