Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to find out the maximum length of both the android:versionName and android:versionCode attributes of the android manifest file?

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
          package="com.xxxx.xxxx"
          android:versionCode="185"           <--- THIS ATTRIBUTE
          android:versionName="1.0.185">      <--- AND THIS ATTRIBUTE

Is there a maximum value or will it pretty much allow anything if there is no maximum are there certain rules in place?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
471 views
Welcome To Ask or Share your Answers For Others

1 Answer

Based on android documentation:

android:versionCode — An integer value that represents the version of the application code, relative to other versions.

Edit - Android documentation explicitly states -

Warning: The greatest possible value for android:versionCode is MAXINT (2147483647). However, if you upload an app with this value, your app can't ever be updated.

Based on oracle documentation:

By default, the int data type is a 32-bit signed two's complement integer, which has a minimum value of -2^31 and a maximum value of (2^31)-1. In Java SE 8 and later, you can use the int data type to represent an unsigned 32-bit integer, which has a minimum value of 0 and a maximum value of (2^32)-1.

android:versionName — A string value that represents the release version of the application code, as it should be shown to users.

Regarding String max length, this SO question may help you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...