Reputation: 207830
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?
Upvotes: 0
Views: 2107
Reputation: 126
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);
Upvotes: 0
Reputation: 200456
You definitely can't do an insert directly. You need to look into ContentProviders, Contacts.Groups and ContactsContract.
Upvotes: 1