On Android, the version code is an integer the system and Google Play use to tell which build is newer. The version name is the string users see, such as 2.4.0. Google Play rejects a version code you have already used, and users only receive an update when its version code is higher than what's installed. The version name has no such rules, so it can even repeat.
The details below follow Google's documentation. Check Android's versioning guide for the current rules.
Android version code vs version name at a glance
versionCode versionName
Type Positive integer String
Used by Android and Google Play People
Shown to users No Yes
Must increase Yes, for updates to install No
Maximum 2100000000 No such limit in the guide
Example 2040017 2.4.0
Android's guide describes versionCode as an internal version number, where higher numbers are more recent.…