Android Basics – What is an R file ?

R is a Java Class file which is autogenerated by Android for your Project. It contains a list of all Resources being used.

For example if you have the following TextView in your Layout

android:text=”Hello Android !!”/>

Android will create the following entry in the R file for this ID.

public static final int helloId=0x7f0c0069;

This helps us to reference this UI component in our Activity Class.

Author: Ankur

I am Enthusiastic about Learning new things and sharing my Knowledge. I like programming and have a pretty good background in Computer Science.

One thought on “Android Basics – What is an R file ?”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: