Maximum Length of Android versionName / versionCode (Manifest)

前端 未结 4 1432
一个人的身影
一个人的身影 2020-12-17 17:58

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



        
4条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-17 18:53

    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.

提交回复
热议问题