How can I make android default phone app take the assigned name to the number from my application database and show it?
An example of what I want to achieve:
Number XXX-XXX-XXX called me yesterday and I don't have its name in my Contact Book BUT I have its name in my application database so in phone app - recents will be shown name of contact from my app database instead of XXX-XXX-XXX.
It is possible by writing values to CACHED_NAME
field in the CallLog.Calls
table.
However there are two issues with this:
CACHED_NAME
field when launched, so it will query the Contacts table for that phone number, will not find any contact with that number and will then clear the name.The only viable solution would be to create a new RawContact per phone-number in your app, with a simple Phone
row and a StructuredName
row.
This will add those numbers to the user's Contacts table, and will also present the names in the call-log app.