0

I want to define some Contact Groups.

I am wondering where and how does Android store the groups. Maybe in a Sqlite database?
If so, will be able to run a insert on it?

Otherwise how do you add new Contacts Group via the emulator?

Pentium10
  • 204,586
  • 122
  • 423
  • 502

2 Answers2

1

You definitely can't do an insert directly. You need to look into ContentProviders, Contacts.Groups and ContactsContract.

Mark B
  • 183,023
  • 24
  • 297
  • 295
0

To add a contact group programmatically:

  ContentValues cv = new ContentValues();
  cv.put(ContactsContract.Groups.TITLE, groupName);
  cv.put(ContactsContract.Groups.GROUP_VISIBLE, 1);
  getContentResolver().insert(ContactsContract.Groups.CONTENT_URI, cv);
johnnie mac
  • 126
  • 1
  • 7