R.java is a file which holds references to project resources. It is automatically generated by the Android Development Toolkit during project compilation.
R.java is auto-generated on build. Its content is based on the resource files (including layouts and preferences). If you delete it, it will be recreated, but if you create your own, you will get into trouble as the build system will not replace it.