4

So in iOS (and most software projects...) there's an incremental build number attribute. In Android, there's a version code attribute.

What is the difference between the two?

asked Oct 19, 2016 at 19:08

2 Answers 2

6

From documentation (emphasis mine):

android:versionCode

An internal version number. This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. This is not the version number shown to users; that number is set by the versionName attribute.

The value must be set as an integer, such as "100". You can define it however you want, as long as each successive version has a higher number. For example, it could be a build number. Or you could translate a version number in "x.y" format to an integer by encoding the "x" and "y" separately in the lower and upper 16 bits. Or you could simply increase the number by one each time a new version is released.

The versionCode is the incremental build number in Android.

answered Oct 19, 2016 at 21:21
Sign up to request clarification or add additional context in comments.

Comments

3

Every new upload of APK on Play Google requires versionCode to be different (ideally one up). This is a number. There is versionName, which can be non number. So if i release first then versionCode will be 1 and i will keep versionName as "1" only. For any minor changes, my versionCode has to be 2 whereas i can keep my versionName as "1.1". Play Google shows versionName to the user (but not versionCode). Hope it helps.

answered Oct 19, 2016 at 20:36

1 Comment

For VersionCode you can use the similar numbering scheme you use in your versionName. For example, in my apps I use versionCode 241 for versionName="2.4.1", 242 for "2.4.2" etc. It's just a matter of personal preference and it's just a number that's being checked in order to determine if the user has the latest version of the app or not.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.