Kailash Dabhi
Kailash Dabhi

Reputation: 3513

rule of changing version of application

My android application is uploaded on google play, now I want to give update of my application but I am confused about android:versionCode and android:versionName.

I want to change version but how to do it? what is the rule of changing the version of application?

I am first time giving a update and this is my code:

android:versionCode="2"
android:versionName="2.0"

Upvotes: 2

Views: 1015

Answers (3)

gideon
gideon

Reputation: 19465

From the docs: http://developer.android.com/tools/publishing/versioning.html

android:versionCode — An integer value that represents the version of the application code, relative to other versions.

So in your case this needs to be 3, because this needs to be an integer value *relative* to your previous versions. When the system checks for an update it should know your current version is higher than the earlier one.

android:versionName — A string value that represents the release version of the application code, as it should be shown to users.

Again, from the docs, this is just for the users display and actually can be anything. The system also doesn't use it except for displaying it to the user. You can put any internal/custom version of your own here.

As an example if you were doing beta releases, your versionCodes could be 1,2,3... but your versionNames could be 0.1,0.2,0.3..

Upvotes: 3

Ram kiran Pachigolla
Ram kiran Pachigolla

Reputation: 21191

versionCode

The versionCode is integer value used to easily differentiate between app versions.

App developers must increment this value when they release updates to their apps in Android Market, so it can determine if users are using an old version of the app, and offer them to update it.

versionName

The versionName is a string containing a regular “release version” as seen in other desktop applications, such as “1.4.5″ or “3.7″.

The versionName is just a “human readable” version code.

For better information about Versioning Your Applications check this

Upvotes: 1

Chirag
Chirag

Reputation: 56935

versionCodes and versionNames are two different things. versionCodes are used by app stores to track updates, while versionNames are more common identifiers like 1.0.0 etc. versionCodes are limited to being integers, while versionNames can be alphanumeric.

Upvotes: 1

Related Questions