I am trying to build an application similar to True Caller. When an incoming call comes my application needs to connect to the server to retrieve contact name of an incoming call number only if it's not available in client's (phone's) contacts.

I am aware of phone look up to search through contacts and broadcast receiver to check when an incoming call comes.

I want to know does my application need to run phone lookup to search through contacts when a call comes? Or can we just retrieve the information about the same when Android by default searches for contact name when the call comes. If yes then please let me know how. If no then my application will run phone lookup. I believe if my application runs phone lookup it would be redundant as android anyway looks for contact name.

Many Thanks

有帮助吗?

解决方案

You can get incoming number from PhoneStateListener.onCallStateChanged(int state, String incomingNumber) event but in order to retrieve caller name you need to make a contact book look up.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top