Feature request: Add sorting to the ContactStore api
See original GitHub issueIt would be really nice if users could sort the data by fields and ASC/DESC order. More specifically, support it on query level in content provider and not on the call site when the data is already fetched.
Currently ContactQueries.kt
use Contacts.DISPLAY_NAME_PRIMARY
as a sort order by default in multiple lookups.
I suggest adding the overloading method fetchContacts
with the 3rd parameter sortOrder
nullable by default, this will not break the existing code to the users and accept sorting order. Instead of String, there can be created some kind of data structure to predefined fields and ASC/DESC behavior. queryContacts
function by default will accept Contacts.DISPLAY_NAME_PRIMARY
as a parameter.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Sorting a Group via the API - Feature Requests
Is there a way to sort the board when an item is added? If I already sorted the board and I add an...
Read more >api to custom files sort order at the sidebar · Issue #12345 ...
Feature Request : api to custom files sort order at the sidebar #12345 ... It would be great if VS Code would allow...
Read more >How should I make a suggestion or feature request? - Sorted³
Suggest · Describe your suggestion completely · The reason that you make such a suggestion · How do you want us to improve...
Read more >sort contacts by recently added - Feature requests - Mailjet
im amazed there is no way to sort contacts by date they were added to the list. I"m trying to test that my...
Read more >Web service API for unified contact store - Google Patents
An Application Programming Interface (API) provides functions for interacting with contact lists and contacts that are stored in a unified contact store by ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I think default should be https://developer.android.com/reference/android/provider/ContactsContract.ContactNameColumns#SORT_KEY_PRIMARY
I would be happy to support such a feature when people find that this is something they need in their day to day development. I wouldn’t want to migrate every feature of the existing Contacts API to Contact Store though. It might happen eventually, but this is not the plan.
The existing Contacts API has been out there for 10 years or so without much update. It is powerful given that you have access to an SQL-like syntax. I am assuming that a lot of the features it provides were introduced because the platform developers were coding against the ContactProvider interface instead of supporting the features app developers would eventually end up using.
Keeping the API lean allows for faster iterations/releases too as there is less things to maintain. I am not saying that the requested feature is not important or it will never make it to Contact Store. Instead, I would rather have the features and capabilities of the API to be driven by dev requirements.