Android Manifest 中的 versionCode 与 versionName [英] versionCode vs versionName in Android Manifest

查看:13
本文介绍了Android Manifest 中的 versionCode 与 versionName的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用在 android 市场上,版本代码 = 2,版本名称 = 1.1

但是,今天更新的时候,我在manifest中修改了version code = 3,却误把我的版本名改成了1.0.1,然后把apk上传到了市场.

现在,我的应用用户是否会在手机上收到更新通知?还是我应该重做一遍这个过程?

解决方案

参考链接

android:versionCode

<块引用>

内部版本号.此数字仅用于确定一个版本是否比另一个版本更新,数字越大表示版本越新.这不是向用户显示的版本号;该数字由 versionName 属性设置.该值必须设置为整数,例如100".您可以根据需要定义它,只要每个后续版本都有一个更高的数字.[...]

android:版本名称

<块引用>

向用户显示的版本名称.此属性可以设置为原始字符串或字符串资源的引用.该字符串除了显示给用户之外没有其他用途.versionCode 属性保存内部使用的重要版本号.

很明显,versionName 只是向用户显示的内容,versionCode 才是最重要的.继续增加它,一切都应该很好.

I had my app in the android market with version code = 2 and version name = 1.1

However, while updating it today, I changed the version code = 3 in the manifest but by mistake changed my version name to 1.0.1 and uploaded the apk to the market.

Now, will the users of my app get an update notification on their phones or not? Or should I redo the process again?

解决方案

Reference Link

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. [...]

android:versionName

The version name shown to users. This attribute can be set as a raw string or as a reference to a string resource. The string has no other purpose than to be displayed to users. The versionCode attribute holds the significant version number used internally.

Reading that it's pretty clear that versionName is just something that's shown to the user, versionCode is what matters. Just keep increasing it and everything should be good.

这篇关于Android Manifest 中的 versionCode 与 versionName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆