4

As PhoneNumberUtils is deprecated, How can we two phone numbers if they're identical enough for caller ID purposes. I mean different formats +44xxxxxxxxxx, 0xxxxxxxxxx

Shri
  • 1,223
  • 5
  • 22
  • 31
  • 1
    [`PhoneNumberUtils`](https://developer.android.com/reference/android/telephony/PhoneNumberUtils.html) is not deprecated, despite what your post says. – Flimm Nov 23 '18 at 11:37

3 Answers3

8

Use the PhoneNumberUtils.compare function doc: http://developer.android.com/reference/android/telephony/PhoneNumberUtils.html

1

reverse strings and compare only first 10 characters?

Ian
  • 3,500
  • 1
  • 24
  • 25
1

The best way would be for you to create a regular expression that would parse the actual phone number xxx-xxxx from any of it's prefixes (+xx, xxx).

Kromagg
  • 69
  • 3