Questions tagged [phonenumberutils]
24 questions
12
votes
1 answer
isPossibleNumber vs. isValidNumber
I am using Google's libphonenumber library to validate phone numbers on the server-side and I noticed that PhoneNumberUtil has two methods for doing this: isPossibleNumber and isValidNumber. What is the difference between them and when should I be…

Lynn
- 423
- 4
- 10
8
votes
2 answers
Formatting phone number to E164 format in Android
I want convert every phone number from conatct in device to E164 format.
So, I used opensource below.
libphonenumber
So I used it like here.
Phonenumber.PhoneNumber formattedNumber = null;
String formatted = null;
try {
formattedNumber =…

Lee Jeongmin
- 793
- 11
- 22
4
votes
4 answers
Android phone number mask for EditText
I'm developing application for Android. In this app user needs sign up and he needs type phone number. I want make mask for this text field in format like +7 (999) 999-99-99. I've tried use mPhoneNumberEditText.addTextChangedListener(new…

Oleg Ryabtsev
- 457
- 2
- 9
- 24
2
votes
0 answers
Android PhoneNumberUtils.formatNumberToE164 India Numbers
I have to validate mobile and phone numbers based on the user's default device country if the user has not entered the international country code. So I was testing for India mobile numbers and I found that irrespective of the user has entered…

Rajen Raiyarela
- 5,526
- 4
- 21
- 41
2
votes
2 answers
Android - phone number formatting and removing the country/area code
I have built an app where I loop through and collect the users phone contacts, my aim is to then use these numbers and query my parse database and look for records that contain the users contacts (this will be to check if any of the users contacts…

Paul Alexander
- 2,686
- 4
- 33
- 69
2
votes
1 answer
Getting ContactName using phone number
I am creating an activity which lists out recent calls from a user. The requirement is that when a user receives the call,the phone number and contact name is stored in DB to be later displayed in the activity. To retrieve the contact Name the phone…

Psypher
- 10,717
- 12
- 59
- 83
1
vote
2 answers
Get user phone number in USA format
I want to fetch phone number X(XXX)XXX-XXX in this format and when I Google I found PhoneNumberUtils.formatNumber() but it gives the number in this format X-XXX-XXX-XXX so how can I get the number in X(XXX)XXX-XXX…
user12790690
1
vote
1 answer
Android format an international phone number string with its country code included
Let's say I have this String:
String phoneNumber = "+15611234567"
Using PhoneNumberUtils.formatNumber(phoneNumber); works here and formats it into +1-561-123-4567
However, when I have a non-US phone number with its country code included, such…

Ali Bdeir
- 4,151
- 10
- 57
- 117
1
vote
1 answer
How to use findNumbers in Google PhoneNumberLib?
I am using Googles Phone Number Library to find phone numbers in a text file. That phone number can be in any format or from any country. Regex is not solving the problem. I was coding in 3rd party python version of it,
but it is not that good and…

anshaj
- 293
- 1
- 6
- 24
1
vote
1 answer
Looking for a table of number of digits in local phone number per country
In order to reformat phone numbers, I would like to use a table saying how many digits to expect in the local phone numbers. It depends on countries: some countries have 10 digits for all local numbers (excluding country and area prefixes), some…

Joshua
- 151
- 1
- 1
- 9
1
vote
1 answer
Get matched region for a number in python's phonenumbers library
I am using python's phonenumbers library to parse and validate numbers like this:
>> import phonenumbers
>>> x = phonenumbers.parse("+442083661177")
>>> print x
Country Code: 44 National Number: 2083661177 Leading Zero: False
And wanted to know…

R.
- 2,818
- 26
- 37
1
vote
1 answer
Difference of Contact No. Format
I'm developing an sms blocker for which I need to save contact numbers in DB and compare them to SMS sender. I've only default SMS application installed on my android phone. But there is difference of contact number format as picked from following…

Ahmed Faraz
- 118
- 1
- 16
1
vote
3 answers
Extracting phone numbers from free text
I'm writing a program that scrapes blog posts from a number of web sites. I'm trying to extract their Australian formatted phone numbers from free text. This has proven to be fairly difficult.
Here are a few constructed blog post examples:
Example…

ChrisRich
- 8,300
- 11
- 48
- 67
1
vote
2 answers
Android compare formatted and unformatted phone number
I have two phone numbers. I want to compare them. One is unformatted and one is formatted, for example:
"0501231234", "050-123-1234".
How can I compare them ( String.equals() )?

User
- 305
- 1
- 3
- 15
0
votes
1 answer
Cannot convert value of type '()' to specified type 'Bool'
How to cast this ?
Cannot convert value of type '()' to specified type 'Bool'

Balasubramani Sundaram
- 1,170
- 3
- 13