Closed nauhalf closed 3 years ago
Hi @nauhalf. This is not something that is currently supported.
I am asuming that you are refering to the Contacts#CONTENT_FILTER_URI, is that correct?
Like this
I am just chipping in as I recently started following this repo and have high hopes of it :)
Some content resolvers have limits on params. For example LIMIT is not allowed but not sure about LIKE. Also, there might be performance issues if user has too many contacts. Some people have thousands of contacts. I would prefer CONTENT_FILTER_URI being used as it seems to be the official way.
+1 for the CONTENT_FILTER_URI approach. If someone really wants/needs to manipulate SQL queries they still have the ContentProviders API to their disposal.
AFAIK such URIs tend to be highly optimised according to the docs, so doing multiple queries shouldn't be expensive.
I think that something like:
combine(
contactStore.fetchContacts(PhoneLookup(PhoneNumber(keyword))),
contactStore.fetchContacts(NameLookup(keyword)) // <- not supported right now
) { fromPhones, fromNames ->
// do any processing to the results you like
fromPhones + fromNames
}.collect { results ->
println("Contacts matching $keyword were = $results")
}
would work well for @nauhalf 's case.
Quick update on this. I am planning of having this shipped this weekend with v0.2.0
Name lookup is now available in 0.2.0
I didn't find any document about filtering contact with LIKE keyword, like the content resolver has. Is it filterable ?