Get Contacts from phone...
Contacts:
{
private Cursor getContacts()// Run queryUri uri = ContactsContract.Contacts.
String[] projection =
ContactsContract.Contacts.
ContactsContract.Contacts.CONTENT_URI;new String[] {_ID,DISPLAY_NAME};
String selection = ContactsContract.Contacts.
(
String sortOrder = ContactsContract.Contacts.
IN_VISIBLE_GROUP + " = '" +mShowInvisible ? "0" : "1") + "'";DISPLAY_NAME + " COLLATE LOCALIZED ASC";//return managedQuery(uri, projection, selection, selectionArgs, sortOrder);
}
Cursor cursor = getContacts();
i = 0;
cursor.moveToFirst();
{
nameL =
numberL =
groupL =
nameL = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.
Log.e(
String contactId = cursor.getString(cursor.getColumnIndex(
ContactsContract.Contacts.
Cursor phones = getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.
numberL = phones.getString( phones.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.
Log.e(
}
phones.close();
Cursor qGroups = getContentResolver().query(
ContactsContract.Groups.
ContactsContract.Groups.
, ContactsContract.Groups.
{
qGroups.moveToFirst();
{
Log.e(
groupL = qGroups.getString(qGroups.getColumnIndex(ContactsContract.Groups.
l++;
qGroups.moveToNext();
}
}
return managedQuery(uri, projection, null, null, sortOrder);while( i < cursor.getCount() )"";"";"";DISPLAY_NAME));"NAME ",""+cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)));_ID));CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ contactId, null, null);while (phones.moveToNext()) {NUMBER)); "NUMBER ",""+numberL);break;CONTENT_URI, new String[] {_ID, ContactsContract.Groups.TITLE}_ID +" = "+ contactId, null, null);if ( null != qGroups )int l =0;while( l < qGroups.getCount())"group Name",""+qGroups.getString(qGroups.getColumnIndex(ContactsContract.Groups.TITLE)));TITLE));break;else{
Log.e(
}
cursor.moveToNext();"groups "," No Group member !!!!!!!!!!!");}
{
private Cursor getContacts()// Run queryUri uri = ContactsContract.Contacts.
String[] projection =
ContactsContract.Contacts.
ContactsContract.Contacts.CONTENT_URI;new String[] {_ID,DISPLAY_NAME};
String selection = ContactsContract.Contacts.
(
String sortOrder = ContactsContract.Contacts.
IN_VISIBLE_GROUP + " = '" +mShowInvisible ? "0" : "1") + "'";DISPLAY_NAME + " COLLATE LOCALIZED ASC";//return managedQuery(uri, projection, selection, selectionArgs, sortOrder);
}
Cursor cursor = getContacts();
i = 0;
cursor.moveToFirst();
{
nameL =
numberL =
groupL =
nameL = cursor.getString(cursor.getColumnIndex(ContactsContract.Data.
Log.e(
String contactId = cursor.getString(cursor.getColumnIndex(
ContactsContract.Contacts.
Cursor phones = getContentResolver().query(
ContactsContract.CommonDataKinds.Phone.
numberL = phones.getString( phones.getColumnIndex(
ContactsContract.CommonDataKinds.Phone.
Log.e(
}
phones.close();
Cursor qGroups = getContentResolver().query(
ContactsContract.Groups.
ContactsContract.Groups.
, ContactsContract.Groups.
{
qGroups.moveToFirst();
{
Log.e(
groupL = qGroups.getString(qGroups.getColumnIndex(ContactsContract.Groups.
l++;
qGroups.moveToNext();
}
}
return managedQuery(uri, projection, null, null, sortOrder);while( i < cursor.getCount() )"";"";"";DISPLAY_NAME));"NAME ",""+cursor.getString(cursor.getColumnIndex(ContactsContract.Data.DISPLAY_NAME)));_ID));CONTENT_URI, null, ContactsContract.CommonDataKinds.Phone.CONTACT_ID +" = "+ contactId, null, null);while (phones.moveToNext()) {NUMBER)); "NUMBER ",""+numberL);break;CONTENT_URI, new String[] {_ID, ContactsContract.Groups.TITLE}_ID +" = "+ contactId, null, null);if ( null != qGroups )int l =0;while( l < qGroups.getCount())"group Name",""+qGroups.getString(qGroups.getColumnIndex(ContactsContract.Groups.TITLE)));TITLE));break;else{
Log.e(
}
cursor.moveToNext();"groups "," No Group member !!!!!!!!!!!");}
Comments
Post a Comment