Show corresponding name when made a call to a number from TinyDB database

I made an app which can call and send sms from TinyDB database shown in ListView. Database has two fields (Name and Number). When I call system shows phone number ( It's normal) but I want it to show corresponding name when make a call and when someone calls from TinyDB database saved number.
Please help.
I used these blocks-


TinyDB is not too comfortable to use for that purpose... if you like to use a local database let me suggest to use the Sqlite database...
Here is my sqlite extension, there are also other extensions available...
https://puravidaapps.com/sqlite.php

This could be your select statements
SELECT name FROM myTable WHERE number = selected number
SELECT number FROM myTable WHERE name = selected name

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by icon24 Taifun.

Many thanks.

Have you any extension which synchronize TinyDB data to android main phonebook. Please reply.

You might be able to use this ContactsSaver: Add contacts without using activity starter