This is an auto generated file in android. If something is created in the activity_main.xml, then an element is created in the R file corresponding to it. A project cannot run without the R file.
If R.jar file is deleted, then android automatically creates one back. It provides access to the resources defined in android. It contains access to resources such as drawables, layouts, strings, arrays etc. One of the advantage is to use different elements for different screens.
For more details refer to: