title: What is the class R in Android?
body: <p>In AndroidStudio, when I create a project using an empty activity, I get the following piece of code in the <code>MainActivity.java</code> file:</p>
  
  <pre><code>package my.company.my_proj;
  
  import android.support.v7.app.AppCompatActivity;
  import android.os.Bundle;
  
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
      }
  }
  </code></pre>
  
  <p>where a cryptic class named <code>R</code> is used. What is the purpose of this class <code>R</code>?</p>