How to get my Caller Id name in code?
I'm trying to retrieve my Caller Id name associated with my number on my phone to use it in a field i开发者_开发知识库n my app. I'm having trouble finding it in the SDK docs. I can get my number from the TelephonyManager, but don't see where I can get my Caller Id name.
Rob W.
I do not believe you are in control of the name associated with your number. The Caller ID name is looked up by the receiving end, and you are not in control of it. See: http://en.wikipedia.org/wiki/Caller_ID
Typically Caller ID provides the receiving phone with the calling number. This calling number is then used by the receiving phone to locate an appropriate friendly name. If no such entry exists in the receiving phone's data store then it just shows the number. If no caller ID is provided then a "Private" or "Call" default text is substituted.
From this, you should be able to conclude that if your own number is stored on your phone then your phone will display your name if you, er, call yourself.
You cannot ever know what someone else is using as the friendly text for your Caller ID since it is local and private to their phone.
I should add that Caller ID is not like a Gravatar.
精彩评论