I did some experimentation yesterday on just this topic.

For a start, it was easy enough to just throw a non-specific query at
the People provider and get back the values for the columns I was
interested in.
I don't know why, but I found that the "NUMBER_KEY" column has the
original phone number, unformatted, but ***reversed***.
So, 800-123-4567 (which is what you'd find in NUMBER column) would be
present as "7654321008" in the NUMBER_KEY column.

My only guess is that someone did some research and found that using
"NUMBER_KEY like '7654321008%' "performed better than "NUMBER_KEY like
'%8001234567' "  (in cases where the phone number stored for the
contact has extra digits - i.e. "+1").  (I really don't know - just
trying to rationalize why it could be backwards)

On Jun 12, 3:28 am, so_is <[email protected]> wrote:
> I would like to add something.
>
> I have recognized that the column "NUMBER_KEY" doesn't get updated at
> all. So I'd like to ask if there is another way to get normalized
> phone numbers?
>
> On 12 Jun., 11:25, code_android_festival_way
>
> <[email protected]> wrote:
> > Hello.
>
> > I am using a PhoneStateListener to determine the incomingNumber for a
> > phone call. What is the right way to get the corresponding contact
> > name?
>
> > I have tried:
>
> >http://paste.pocoo.org/show/LuRcRJZImQvEgSpE1uzV/
>
> > ( I have also used People.NUMBER_KEY)
>
> > But I'm always getting a cursor with the count of zero. (the number is
> > in the phonebook)
>
> > Why doesn't that work?
>
> > I'm looking forward reading your responses. Thank you very much.
>
> > Regards
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to