Android: Directory data provider for PhoneLookup
Asked Answered
C

0

6

I'm writing a custom Android contacts directory, I have implemented the ContactsContract.Directory provider and the search from within the phone app works fine.

The problem I am facing now is that when I have an incoming/outgoing call the Android dialer does not query the custom directory I registered. Is it possible to partake in caller ID resolution via PhoneLookup or some other way?

Also as a possible workaround I have tried implementing an outgoing/incoming call interceptor with BroadcastReceiver but I see no way of returning the contact data to the dialer. The only option I have found for displaying the data is to overlay a transparent activity over the native dialer. Is there a way to return contact data back to the dialer that sent the broadcast? Any other ideas I could try?

PS. Google uses the functionality I'm trying to implement for nearby places directory listings and Caller ID by Google.

PPS. By reading the ContactsContract implementation of PhoneLookup I stumbled upon corporate contacts directory that can be appended to the user profile's default directory, according to the code it should get queried for PhoneLookup, so I'm going to try that on Monday.

Cupo answered 20/8, 2015 at 13:56 Comment(6)
Hi did you have any success with this? I need to do the same but would rather not user an overlay if possiblePoyssick
Unfortunately no, it seems that the only way to do this is to write a custom dialer, I ended up using an overlay.Cupo
Hi, would you share how exactly you implemented the ContactsContract.Directory?Politicking
Please refer to programcreek.com/java-api-examples/… there are also numerous other examples.Cupo
Any new about this? I have same problem, on emulator on incoming call phone lookup searches my custom directory but on real device its not working.Skyward
Check out my answer here: Provide the caller id for incoming call from my own appCrappie

© 2022 - 2024 — McMap. All rights reserved.