Google has defined two version number attributes for the APK: Versioncode and Versionname, they have different uses.
Versioncode: not visible to consumers. Use only for the application market, the program internal identification version number, infer the old and new purposes.
Versionname: Show to consumers, consumers will be aware of their own installed version number, the version number mentioned below is said Versionname.
At the end there are three common problem solving methods
The same version, the corresponding multiple versioncode what to do
Published a versioncode wrong version number what to do
Issued to the application has a bug to change back to the old version, how to do?
And talk about the causes and consequences.
When we use software and applications, we all know about the concept of version number. For example, Win xp,qq2012, Xiaomi desktop 1.6.
There is a version number, mainly because the SOFTWARE product has been developing and changing.
The concept of a version number can help consumers identify products at different times of the year.
And the version number that the consumer is facing now, and the developer is used inside the general is different version number. The development of the general use of numbers as a sign, for example 6.1.7600.16385. In fact is win 7 the first official version of the number, and win 7 SP1 version number is 6.1.7601.17514, so long a string of numbers for the consumer meaningless, so when the product is published generally a more easy to understand the version number. The version number that is used to display the win 7 is called [versionname],6.1.7601.17514, which is the version number used for the program ID, which is called [Versioncode].
In the early days because the software mainly responsible for their own distribution, upgrade and so on. So the version number is also quite free, each family has different specifications. But mobile devices have risen in recent years, and the App Store has been centralized and distributed in the mainstream. To upgrade, for example, the store will be responsible for checking the version number of the app on the consumer's phone and the latest version number in the store, assuming that the version number in the store is newer and the version number on the consumer's phone is older. Will remind consumers to upgrade.
This involves how to identify new and old problems.
For the computer, the most reliable way to infer is the number, the number has a lot of advantages: easy to infer the program, the format is simple error, easily identify the naked eye and so on.
So Google requires every app to record this installation package in the APK installer [Versioncode], just to get the apk file. will be able to know its corresponding [Versioncode] is how much, the store will use this [Versioncode] to infer the version number. The larger the [Versioncode] number of the installation package, the more new. So developers in the development process, each has a new version number just a little more this number can be. For example, the first version number of [Versioncode] is 1, the second version number is 2. Because a developer may produce multiple, unpublished version numbers per day. So this number is going to grow very fast.
After a period of development, this figure will become larger, for example, 16385, then to a consumer, this number is actually not very recognizable, for example, win 16385 and win 17514 in the transmission of information is not good, not conducive to product marketing. So Google also supports recording [Versionname] within the AKP installation package. You can call Win 7, Win Vista is no problem. Able to meet market and communication needs, so [versionname] actually does not have the ability to compare new and older version numbers. Just to show it to the consumer.
Sum up
Versioncode: not visible to consumers, only for the application market, the program internal identification version number, infer the old and new purposes.
Versionname: Show to consumers that consumers will recognize their installed version number. The version number we're talking about is this.
We are in the process of operation. Some developers are found to be experiencing some problems.
1, the same versionname (version). Multiple versioncode are corresponding
This is not a common situation, for example, after the release of the new version number, a store feedback that there is a XXX problem, need to repair, customization and so on. So the business to find the project teacher out a new version number. Considering that the minor version number is upgraded, the version number has not changed, but Versioncode has changed.
Possible problems: Let's say that this new version is only part of the store line. will appear in the 3.1 version, a store's version number is actually newer than the B store.
The user who has installed the new version number. will also be prompted to upgrade, this time users will be troubled. Why am I loading 3.1 and upgrading to 3.1? Some stores are catching bags for the latest. Causes the channel package to run, affects the operation monitoring and the analysis.
Workaround: A. The version number should rise with the versioncode. And once the new version number is released, it is available on all channels.
2, published a versioncode wrong version number
Sometimes, because the project teacher accidentally, published a versioncode too large version number, For example 1.1. The 1.20 version of the Versioncode is written in 111, and the 1.1.1.27 version number of the Versioncode written 11127, but later published 1.1. Version 2 wants to continue the old Versioncode, with 112.
Possible issues: 1.1.1.27 version of the user will not be able to get 1.1.2 version number of the upgrade, because in the program appears 1.1.1.27 The version number is relatively new, at the same time, the user who has used the 1.1.2 version number may receive an upgrade hint for the old version number, and downgrade it back to the older version
Solution: actually very easy. Since Versioncode is not visible to the user at last. Just add it just fine. The example above, the new version of Versioncode directly take 11200 to live.
3, published a bug version number. Okay, catch the rush.
Occasionally, the version number has been published. The next day suddenly found, bad, there is a bug, the user began to scold!
So the business students to each market request to return the old version number.
Possible issues: Users who have been upgraded to a bug version number cannot be rolled back to the previous version, so it is irresponsible for these enthusiastic users to revert to the old versions directly.
And the strength of human recall is limited, this bug version number will be circulated.
Solution: It is best not to waste time to return to the old version, fix the bug to send a new version number (remember to add Versioncode), if the bug is more difficult, temporary can not repair, only can return the old version number. It is recommended that the old version number of the Versioncode be larger, the new version number, so that all users can download/upgrade to a relatively reliable version number.
These are some suggestions for the Android app version number.
Hope to be of help to everyone.
Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.
Androidmanifest:versioncode and Versionname