title: Adding Contact Name to Android
body: <p>I am using the following code:</p>
  
  <pre><code>ArrayList&lt;ContentValues&gt; data = new ArrayList&lt;ContentValues&gt;();
  
        ContentValues name = new ContentValues();
        name.put(Data.MIMETYPE, StructuredName.CONTENT_ITEM_TYPE);
        name.put(StructuredName.GIVEN_NAME, "first name");
        name.put(StructuredName.FAMILY_NAME, "last name");
        data.add(name);
  
        ContentValues row2 = new ContentValues();
        row2.put(Data.MIMETYPE, Email.CONTENT_ITEM_TYPE);
        row2.put(Email.TYPE, Email.TYPE_CUSTOM);
        row2.put(Email.LABEL, "Green Bot");
        row2.put(Email.ADDRESS, "android@android.com");
        data.add(row2);
  
        Intent intent = new Intent(Intent.ACTION_INSERT, Contacts.CONTENT_URI);
        intent.putParcelableArrayListExtra(Insert.DATA, data);
  
        startActivity(intent);
  </code></pre>
  
  <p>However, only the email is added. The name fields are set empty.</p>
  
  <p><strong>Update:</strong>
  Same goes for the address!</p>
  
  <pre><code>ContentValues address = new ContentValues();
        address.put(Data.MIMETYPE, StructuredPostal.CONTENT_ITEM_TYPE);
        address.put(StructuredPostal.CITY, "Nasr City");
        address.put(StructuredPostal.COUNTRY, "Egypt");
        address.put(StructuredPostal.REGION, "Cairo");
        address.put(StructuredPostal.TYPE, StructuredPostal.TYPE_WORK);
        data.add(address);
  </code></pre>
  
  <p>Email, phone number, website, IM and photo works fine.</p>