What happens if use the same "versionCode" for multiple app releases? - android

According to the official documentation (Versioning your applications), the "android:versionCode" must be increased with every release of an Android application.
For release versions supposed to be uploaded to Google Play, I understand why this is necessary. However, what about nightly builds, mainly aimed at developers? For these, the versionCode would need to be generated, which is not straightforward (SCM like Git without numeric commit id, possibly multiple builds from the same commit etc.).
So, my question:
Can I just use a constant versionCode for nightly builds? What consequences will this have (apart from not being able to upload to Google Play)?

Can I just use a constant versionCode for nightly builds?
Sure. That's what happens every time you run your app from your IDE, after all, unless you have scripted something (e.g., in Gradle) yourself to generate a unique versionCode.
What consequences will this have (apart from not being able to upload to Google Play)?
Nothing that's any different from doing builds in the IDE, other than things that are more tied to doing centralized builds, more so than versionCode (e.g., certificate mismatch errors, unless everyone and the CI server are synchronized to use the same debug keystore).

VersionCode is used to upgrade your apps, if you are using the same versionCode in your ease release, it will oveeride your apk file and don't able to install your new release file in which you have made some changes in it
In android you have versionCode and versionName by default. versionCode is an integer that is used by Google Play Store to make sure that you are uploading a new version of the app
For e.g. If you are releasing your fisrt app to playstore, your versionCode is android:versionCode="1" and if you're releasing your second version, your android:versionCode="2", so it will always increasing.

Related

Versioning an android app with multiple flavors

I'm trying to figure out a good way to version my android app.
Problem is that we have multiple environments:
Standard production environment for most of the users
Beta environment so users can see the latest additions (WIP)
Test environment which is an internal release of the app so our own people can use the system.
All 3 environments will have both debug and release, release will be the default that is being used. The debug is only in case there are issues we can't figure out and might be hardware related as this app will be used on our specified devices (so not every device can use it, I mean they could but it might not work as expected).
So I don't know what versioning to use as basically a feature is released only to the test environment, so our internal users can test it.
Once that feature is accepted as a good working feature without bugs or anything (or atleast as low possible) we release it in the beta environment so our customer can give their own thought about this feature so we can get an idea of our customer requirements.
Once we gather that information we compile it and then discuss if we should implement it in our production environment, once it has been accepted as a new feature, we launch it to our production environment.
So because we don't update our production environment that frequently as it has to get through test and beta environment, I am wondering what might be a good versioning system for this?
I know that many use the "major.minor.patch" versioning but I don't know if this will work in this case.
Any ideas?
My thought:
I was thinking to maybe use "major.minor.patch" versioning of production and for the beta and test environment I would do "major.minor.patch-environment-major.minor.patch" so we can see how many changes we have applied to it since the last update to production.
But I don't know if that's a good idea or not...
You can give version to each flavors separately like below
productFlavors {
Standard{
versionCode 1
versionName "1.0.0"
}
Beta {
versionCode 2
versionName "1.2.0"
}
Test {
versionCode 3
versionName "1.3.0"
}
}
inside app level build.gradel

Using version 1.x.x for android public beta app without having a production app

I wish to release a new app as public beta for Android and production for iOS. I wish to have the same version numbers for both. But, iOS doesn't allow version less than 1.0.0 for production, correct me if I am wrong.
So can I use version 1.x.x for an android public beta app?
Is there any restrictions in Google play to use appropriate version numbers?
You can use whatever versionName you want. The only thing that matters is the versionCodes have to increment. You can't upload a new APK with a matching or lower version code.
The versionName has no purpose other than to be displayed to users.
https://developer.android.com/studio/publish/versioning.html
On gradle you set "versionCode" with an integer, this integer must be necessarily superior to the previous version. check play console for help about alpha-beta versionCode hierarchies.
on the same gradle you set "versionName" string, the info that your apps users will see, this is a free textfield, you can use "1.x.x" or "1.xx.xx_beta"
productFlavors allows free texfields too
check the "app info" about apps instaled on your device and compare styles

Upload an app to GooglePlay without versionCode neither versionName?

I thought it was not possible, but why mistake we were able to upload an apk to GooglePlay without VersionCode neither VersionName. If it's possible, which is the version code the app is going to have?

How to define the number of version code for android project?

In build.gradle file, there is an attribute called versionCode. Whenever I make an update to the project, should I increase the value of versionCode?
android:versionCode —
An integer value that represents the version of the application code,
relative to other versions.
Typically, you would release the first version of your application
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 android:versionCode value does
not necessarily have a strong resemblance to the application release
version that is visible to the user. Applications and publishing
services should not display this version value to users.
Screenshot of versionCode at Play Store Developer Console:
android:versionName —
A string value that represents the release version of the application
code, as it should be shown to users.
Screenshot of versionName in Already Published app at Play Store:
Summary: Version code is for keeping track of your application update, which is basically used when you upload a new apk in the Play Store. On the other hand versionName is a String that is visible to user so that they can see there's a new version available.
Source: Versioning Your Applications
You should increase the versionCode for any new version you plan to release on Google Play (or whatever other distribution channels you use) as an update to the existing version. For internal testing, you don't have to increment the versionCode since you can force a reinstall.
If u plan on publishing your app to playstore then each update must have different verionCode and versionName is simply for developers to keep track of major changes and updates.
You need to increase the value of version code only when you are publishing the app otherwise there is no need to increase it. You can continue with the same version code

Android App Versioning

I have android app published in google play with the following version:
android:versionCode="1"
android:versionName="1.0"
I think that's the default version when creating android app in Eclipse IDE. I made minor changes in my app. I want to publish the updated app. What is the recommended versionCode and versionName for the updated app?
What I want is that users who already installed the app will be notified by google play that a new version is available. Im new to android development. In my device, I received notification for my installed app that there are new version available. I want this functionality.
I'm thinking of having:
android:versionCode="2"
android:versionName="1.0.1"
Is that OK?
thanks
Yes thats perfect.
Typically, you would release the first version of your application
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 android:versionCode value does not
necessarily have a strong resemblance to the application release
version that is visible to the user (see android:versionName, below).
Applications and publishing services should not display this version
value to users.
As with android:versionCode, the system does not use this value for
any internal purpose, other than to enable applications to display it
to users. Publishing services may also extract the android:versionName
value for display to users.
Ref : Versioning Your Applications and versionCode vs versionName in Android Manifest
Yes that's correct.
The versionCode needs to increment but the versionName can be any string to be shown to your users.
See docs for fuller explanation: http://developer.android.com/tools/publishing/versioning.html

Categories

Resources