Hi,
I have written code to add a number in contact book when the application is used.
ContentResolver cr = getContentResolver();
Uri phoneUri = null;
ContentValues values = new ContentValues();
values.put(People.NAME, "stack");
Uri uri = getContentResolver().insert(People.CONTENT_URI, values);
phoneUri = Uri.withAppendedPath(uri, People.Phones.CONTENT_DIRECTORY);
values.clear();
values.put(People.Phones.TYPE, People.Phones.TYPE_MOBILE);
values.put(People.Phones.NUMBER, "9879958170");
getContentResolver().insert(phoneUri, values);
and even added the permission in .manifest file.
<uses-permission android:name="android.permission.READ_CONTACTS"
android:enabled="true" />
<uses-permission android:name="android.permission.WRITE_CONTACTS"
android:enabled="true" />
this is working on emulator the contact gets added but..when i put this application into device....there is no contact with name stack...
Can anyone help me and let me know if i have done any mistake.
Thanks in advance:)