address book sorting | developer.brewmp.com address book sorting | developer.brewmp.com

Developer

address book sorting

Forums:

hi,

I want to know, how to sort records in an address book, based on some specific criteria, say descending/ ascending order.

By default the address book sorts the records based on the " name" field in ascending order. Please tell me if there is any property , so that the records get sorted in any different way, e.g. descending order.

Thanks,
Venkateswarlu

I haven't seen devices implement sorting (other than the default alphabetical order) of contacts at the native level. Sorting is not exposed at the BREW layer either.
The only way I can think of reverse sorting is doing it manually. Create IADDRBOOK with the property ABP_NO_SORT_CACHE. Simply go through all the names (which you will receive in random order) and insert into your custom data structure in a reverse sorted order. Now most devices support at max 100 contacts so this should be fairly quick. You can then display the data in any way you require and if you need to fetch the record itself you can do a searchable query with IADDRBOOK_EnumRecInit()

I haven't seen devices implement sorting (other than the default alphabetical order) of contacts at the native level. Sorting is not exposed at the BREW layer either.
The only way I can think of reverse sorting is doing it manually. Create IADDRBOOK with the property ABP_NO_SORT_CACHE. Simply go through all the names (which you will receive in random order) and insert into your custom data structure in a reverse sorted order. Now most devices support at max 100 contacts so this should be fairly quick. You can then display the data in any way you require and if you need to fetch the record itself you can do a searchable query with IADDRBOOK_EnumRecInit()

Thank u ayangar
By default the address book sorts the records based on the " name" field in ascending order. is there any way to sort the records based on the last name or fistname..?
Thanx
venkateswarlu

Thank u ayangar
By default the address book sorts the records based on the " name" field in ascending order. is there any way to sort the records based on the last name or fistname..?
Thanx
venkateswarlu