2009-10-01 06:34:28 +08:00
|
|
|
package com.phonegap.demo;
|
|
|
|
|
|
|
|
import android.provider.Contacts.People;
|
2009-10-10 01:23:21 +08:00
|
|
|
import android.content.ContentResolver;
|
2009-10-01 06:34:28 +08:00
|
|
|
import android.content.ContentUris;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.database.Cursor;
|
|
|
|
|
|
|
|
public class ContactManager {
|
|
|
|
|
2009-10-10 01:23:21 +08:00
|
|
|
public void grabContacts()
|
|
|
|
{
|
|
|
|
Uri people = android.provider.Contacts.People.CONTENT_URI;
|
|
|
|
Uri phone = android.provider.Contacts.Phones.CONTENT_URI;
|
|
|
|
}
|
|
|
|
|
|
|
|
private void getColumnData(Cursor cur){
|
|
|
|
|
|
|
|
ContentResolver cr = getContentResolver();
|
|
|
|
|
|
|
|
|
2009-10-01 06:34:28 +08:00
|
|
|
if (cur.moveToFirst()) {
|
|
|
|
|
|
|
|
String name;
|
|
|
|
String phoneNumber;
|
|
|
|
int nameColumn = cur.getColumnIndex(People.NAME);
|
|
|
|
int phoneColumn = cur.getColumnIndex(People.NUMBER);
|
|
|
|
String imagePath;
|
|
|
|
|
|
|
|
do {
|
|
|
|
// Get the field values
|
|
|
|
name = cur.getString(nameColumn);
|
|
|
|
phoneNumber = cur.getString(phoneColumn);
|
|
|
|
|
2009-10-10 01:23:21 +08:00
|
|
|
|
|
|
|
|
2009-10-01 06:34:28 +08:00
|
|
|
} while (cur.moveToNext());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|