I am trying to a build an Android Dialer App (MinSDK 23).
I'd like to implement a contacts search (usually available in default dialer apps and other third party dialer apps) like below:
As I type digits on dial pad e.g. 245
I should be able to search contacts having phone numbers containing '245' as well as their names containing matches for alphabetical combinations of the digits 245, that as per my calculation should be 27 unique combinations.
While I do know it's a permutations problem and I might be able to search by applying OR 'LIKE' filters on Contacts Name, this doesn't seem efficient enough and it will cause more performance issues as I keep typing e.g. 245658.
How do we do this efficiently? Is there any built-in search mechanism for searching android contacts this way or any better custom solution exists?