title: Issue while access contacts of android
body: <p>I am new for android development. I am trying read and write contacts to android addressbook.</p>
  
  <p>I tried following line of code for write name into android</p>
  
  <pre><code>public class SecondApp extends Activity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState); 
  setContentView(R.layout.main); 
  
  ContentValues values = new ContentValues();
  values.put(Contacts.People.NAME, "Rishabh");
  ContentResolver cr = getContentResolver();
  Uri uri = cr.insert(People.CONTENT_URI, values); 
  </code></pre>
  
  <p>but i am getting "The application has stopped unexpectedly. Please try again" message.</p>
  
  <p>what is wrong in it ?
  How can i access contacts of android ?</p>
  
  <hr>
  
  <p>Hi MannyNS thanks for reply
  I have given write permission as you defined above.</p>
  
  <p>but i am still getting the "The application has stopped unexpectedly. Please try again", even when i start android its giving message "Process android.process media is not responding".</p>
  
  <p>Can you suggest me whole procedure to read and write contacts to android ?
  Do you have any sample code for it ?</p>
  
  <p>Thanks 
  Rishabh</p>