What does COLLATE LOCALIZED ASC stand for?

Pentium10 picture Pentium10 · Mar 4, 2010 · Viewed 12.5k times · Source
private Cursor getContacts() {
    // Run query
    Uri uri = ContactsContract.Contacts.CONTENT_URI;
    String[] projection = new String[] {
            ContactsContract.Contacts._ID,
            ContactsContract.Contacts.DISPLAY_NAME
    };
    String selection = ContactsContract.Contacts.IN_VISIBLE_GROUP + " = '" +
            (mShowInvisible ? "0" : "1") + "'";
    String[] selectionArgs = null;
    String sortOrder = ContactsContract.Contacts.DISPLAY_NAME +
            " COLLATE LOCALIZED ASC";

    return managedQuery(uri, projection, selection, selectionArgs, sortOrder);
}

What does COLLATE LOCALIZED ASC stand for?

Answer

Kris picture Kris · Mar 4, 2010

Collate is just fancy speak for sort (well sort of). So this is sort ordering based on localized preferences (i.e. current language's alphabet and conventions) in ascending order.