4

Google should really document their contacts API, its really irritating to find out how to insert specific details.

Anyways,

I want to send following contact details to Contact native application of android:

  1. Name
  2. Last Name [Family Name]
  3. Street Address
  4. City
  5. State
  6. Zip Code
  7. Contact Phone no.

I have figured out that Family name is stored in ContactsContract.CommonDataKinds.StructuredName.FAMILY_NAME

Anyhelp will really be appreciated. And if you know any other columns insertion beyond these mentioned. I am ready to buy it. Only condition is it should use ContactsContract i.e. above android 2.1 API Level 5

Thankx :)

Shardul
  • 786
  • 3
  • 11
  • 20
  • Hello, I also working for the same..did you anyhow managed to pass Family name? please if you have found the way..tell me..thanks :) – MKJParekh Nov 24 '11 at 07:32

2 Answers2

1

To set the name, your code would be like :

ConactsIntent.putExtra(ContactsContract.Intents.Insert.NAME, firstName);

Try Adding a space in between first name and the last name.

ConactsIntent.putExtra(ContactsContract.Intents.Insert.NAME, firstName+" "+lastName);
Anand Undavia
  • 3,493
  • 5
  • 19
  • 33
0
ContactsContract.CommonDataKinds.StructuredPostal.STREET
ContactsContract.CommonDataKinds.StructuredPostal.CITY
ContactsContract.CommonDataKinds.StructuredPostal.REGION
ContactsContract.CommonDataKinds.StructuredPostal.POSTCODE
ContactsContract.CommonDataKinds.Phone.NUMBER

You'll find all of them here.

RufusInZen
  • 2,119
  • 1
  • 19
  • 26