This is my problem: I am writing an alternative application for contacts, which is indicated for working with LOT of different languages and alphabets. When querying for names in my native language, Swedish, names using umlaut characters are sorted illogically to me, but logically for unicode I assume:
Must be / Swedish style: A, B, C, ..., Z, Å, Ä, ....
Query result: A, Å, Ä, B, ..., N, O, ..., P, ...
I guess this will be a problem in any language that is different from the Latin alphabet. All the tests that I have done are on the emulator. My development team is making changes to the structure, so low-level answers are also welcome.
Uri uri = ContactsContract.Contacts.CONTENT_URI; String[] projection = new String[] { ContactsContract.Contacts._ID, ContactsContract.Contacts.DISPLAY_NAME, ContactsContract.Contacts.PHOTO_ID }; String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '1'"; String sortOrder = ContactsContract.Contacts.DISPLAY_NAME + " COLLATE LOCALIZED ASC"; mCursor = managedQuery(uri, projection, null, null, sortOrder);
Update: we are currently exploring this track: Sorting an array of strings , TBC ... I also added it as a problem in Google Code.