I know in Java there are two kinds of integers. First is “int” which is the primitive integer. The second is “Integer” which is a class with methods and stuff.
While programming for Android I saw another type: “integer” with all lowercase chars. It is declared in “android.R” namespace and there is only four static methods in it.
What is it? Why is it there? What is its relation with “int” and “Integer” (if any?)
R.integer is the integer resource file for integers defined in xml. Just like R.layout, R.style, R.id, R.string etc. Here an explanation what it is used for. Basically a
<integer> </integer>resource element in a xml file in the res/values folder.Edit: oops you asked what the integer resource value in the android.R namespace was. In my explanation above, I explained how these are declared in your own application namecpace. The .integer resource values in the android.R namespace are the same, but are declared and used in the Android framework for animation durations.
This SO question is about what the value of the constants in android.R.integer actually is. Somewhere in the android framework there is a
res/values/<name>.xmlwhich declares these Integer constants.