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

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

问题描述

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

然而,今天更新的时候,我在manifest中修改了版本代码= 3,但错误地将我的版本名称更改为1.0.1并将apk上传到市场.

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

解决方案

参考链接

android:versionCode

<块引用>

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

android:versionName

<块引用>

向用户显示的版本名称.此属性可以设置为原始字符串或对字符串资源的引用.除了向用户显示之外,该字符串没有其他用途.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 清单中的 versionCode 与 versionName的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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