Reputation: 573
I read that if we want to update an app in google play, the version Code should be higher than the previous apk file. I've an app with version code: 20 and version name 1.0. So to update the app, how should I increase the version code? Should it increase by 10? or just 1 is enough? ie, version code from 20 to 30 or version code from 20 to 21?
Upvotes: 3
Views: 3520
Reputation: 2173
You can use the Play Core Library In-app updates to tackle this. You can check for update availability and install them if available seamlessly.
In-app updates are not compatible with apps that use APK expansion files (.obb files). You can either go for flexible downloads or immediate updates which Google Play takes care of downloading and installing the update for you.
dependencies {
implementation 'com.google.android.play:core:1.5.0'
...
}
Note that, In-app updates works only with devices running Android 5.0 (API level 21) or higher, and requires you to use Play Core library 1.5.0 or higher. '
I hope this will help somebody
Upvotes: 2
Reputation: 75788
This number is used only to determine whether one version is more recent than another, with higher numbers indicating more recent versions. Typically, you would release the first version of your app with versionCode set to 1, then monotonically increase the value with each release, regardless whether the release constitutes a major or minor release. This means that the versionCode value does not necessarily have a strong resemblance to the app release version that is visible to the user (see versionName, below). Apps and publishing services should not display this version value to users.
defaultConfig
{
minSdkVersion 17
targetSdkVersion 23
versionCode 1 // Default , You can increase 1 when update .
versionName "1.0"
}
Upvotes: 2
Reputation: 31
Basically, For update your apk you should update version code to 21(just 1 increase) and your version name.
Upvotes: 1
Reputation: 74
I increased it from code 1 and version 1.0 to code 2 and version 1.1 . That's also what it says in my developer console. So just do as you wish
Upvotes: 1