Skip to main content

Posts

Showing posts with the label r.java-file

Protected Android IDs in R.java

For those of use who have spent any amount of time in the Android source code, it's not news that the IDs generated in the android.R class do not 1:1 reflect the actual resources found in the res/ directories of the supplied JAR. Many of the drawables/styles/layouts are not "public" and accessible to applications by referencing android.R.xxx . My question is does anyone know the mechanism by which Android is able to generate an R.java class that differs from the actual resource graph? Secondarily, is it a mechanism (using build rules, etc.) that we as developers could leverage to partially protect the ids that get made public in applications used as libraries? Thanks in advance! Source: Tips4all