get my phone contacts android :-
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null);
while (phones.moveToNext())
{
String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
txt.append(name+ " -"+phoneNumber);
}
phones.close();
nice link to create .csv file
http://stackoverflow.com/questions/4632501/android-generate-csv-file-from-table-values
Cursor phones = getContentResolver().query(ContactsContract.CommonDataKinds.Phone.CONTENT_URI, null,null,null, null);
while (phones.moveToNext())
{
String name=phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME));
String phoneNumber = phones.getString(phones.getColumnIndex(ContactsContract.CommonDataKinds.Phone.NUMBER));
txt.append(name+ " -"+phoneNumber);
}
phones.close();
nice link to create .csv file
http://stackoverflow.com/questions/4632501/android-generate-csv-file-from-table-values
No comments:
Post a Comment