What does R mean in java
R stands for resource in Java, and the full form is Resource.
Resources are used almost everywhere in project development, including layout, string, drawable, raw, style, theme, etc. These resources will be packaged into APK (res folder) during the compilation process or packaged into independent resource APK packages (such as framework-res.apk).
But these resources will be given unique IDs, namely resource indexes, to facilitate system access.
These resource indexes are eight-digit hexadecimal integers generated by Android's tool AAPT (Android Asset Packing Tool).
The middle 02 position value represents the type of resource corresponding to the resource ID, which are:
02: drawable
03: layout
04: values
05: xml
06: raw
07: color
08: menu
R.java file example
public final class R { public static final class attr { } public static final class drawable { public static final int icon=0x7f020000; } public static final class layout { public static final int main=0x7f030000; } public static final class string { public static final int app_name=0x7f040001; public static final int hello=0x7f040000; } }
(Related video tutorial sharing: java video tutorial)
The above is the detailed content of What does R mean in java. For more information, please follow other related articles on the PHP Chinese website!