I made a programe to update phonetic_names of contacts.

Pronunciation p = new Pronunciation(getResources().openRawResource(
        R.raw.pronunciations));
Cursor c = getContentResolver()
        .query(People.CONTENT_URI, null, "NAME != ''",
                null, People.DEFAULT_SORT_ORDER);
int idx_name = c.getColumnIndex(People.NAME);
int idx_id = c.getColumnIndex(People._ID);
while (c.moveToNext()) {
    ContentValues v = new ContentValues();
    v.put(People.PHONETIC_NAME, p
            .get(c.getString(idx_name)));
    Uri u = ContentUris.withAppendedId(People.CONTENT_URI,
            c.getInt(idx_id));
    getContentResolver().update(u, v, null, null);
}

It's very slow. I think it can be fast if there is a transaction. But
I don't know how.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to