Questions tagged [libphonenumber]

Google's common Java, C++ and Javascript library for parsing, formatting, storing and validating international phone numbers. The Java version is optimized for running on smartphones, and is used by the Android framework since 4.0 (Ice Cream Sandwich).

libphonenumber is a library for handling phone numbers. It can parse and format phone numbers as well as provide geographical information about phone numbers.

libphonenumber is written by Google engineers and is used in Android and other Google projects.

230 questions
98
votes
7 answers

Extract code country from phone number [libphonenumber]

I have a string like this : +33123456789 (french phone number). I want to extract the country code (+33) without knowing the country. For example, it should work if i have another phone from another country. I use the google library…
mrroboaat
  • 5,602
  • 7
  • 37
  • 65
46
votes
4 answers

libphonenumber standalone (without masses of google dependencies)? Alternate lib?

I am looking at using http://code.google.com/p/libphonenumber/ for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except…
S42
  • 1,061
  • 2
  • 10
  • 16
34
votes
11 answers

Listing all country codes of phone numbers

I'd like to have the country code list for phone numbers. Such as, United State (+1), United Kingdom (+44) ... I know that libphonenumber is a great tool to help phone parsing, formatting and validation. However, it doesn't seem to have the…
ann
  • 351
  • 1
  • 3
  • 3
18
votes
2 answers

libphonenumber - formatting phone numbers without knowing the country code

I have heard a lot of good from what appears to be an awesome library but I find myself in a delicate situation. This is the first project I have ever worked where I am supposed to store phone numbers in a database. I have read a bit about the E.164…
Mackovich
  • 3,319
  • 6
  • 35
  • 73
18
votes
2 answers

How to format a phone numbers with libphonenumber in International format.

In the documentation provided by libphonenumber on Github, there is a demo, which converts any provided number into International Format, e.g +4915213116250 is converted into +49 1521 3116250 I want to use the same functionality in C#. In the…
Kamran
  • 4,010
  • 14
  • 60
  • 112
15
votes
8 answers

Using LibPhoneNumber google lib in Android

The library libphonenumber doesn't work on Android and the exception says: "Caused by: java.lang.UnsupportedOperationException: CANON_EQ flag not supported" The description in the webpage says that the lib is for "Smartphones" but Android doesn't…
shaimagz
  • 1,265
  • 4
  • 17
  • 39
14
votes
1 answer

Using libphonenumber with JavaScript in HTML

libphonenumber is quite the confusing tool to figure out considering the plethora of implementations and examples found all over the web, so please bear with me. I'm simlpy trying to use this package like I've used every other JavaScript library…
Chockomonkey
  • 3,895
  • 7
  • 38
  • 55
14
votes
6 answers

android: how do I format number as phone with parentheses

I have a number that I need to format as a telephone number. If I do PhoneNumberUtils.formatNumber(numStr); Then I get 888-555-1234 But what I need to get is (888) 555-1234 How do I get the second one? Is there a standard android way?
user3093402
  • 1,419
  • 4
  • 20
  • 28
13
votes
3 answers

libphonenumber for iOS or objective-c port

My goal is to use libphonenumber, google's phone number handling library for an iPhone project I'm working on. After downloading it (and many many hours), I complied the C++ version of the library, and it built a number ".a" files and ".dylib"…
cohen72
  • 2,830
  • 29
  • 44
12
votes
1 answer

Is there any sample for @angular-libphonenumber with angular 2 or higher?

I am trying to create a directive for formatting and validating the phone numbers in my angualr 4 application, was looking for some guidance to getting started.
ram_p
  • 123
  • 1
  • 4
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
12
votes
2 answers

Convert to E164 only if possible?

Can I determine if the user entered a phone number that can be safely formatted into E164? For Germany, this requires that the user started his entry with a local area code. For example, 123456 may be a subscriber number in his city, but it cannot…
Norbert
  • 4,239
  • 7
  • 37
  • 59
12
votes
3 answers

How to host the google libphonenumber locally?

During development on my localhost, I am trying to self host the libphonenumber library. I am trying with the following:
blueFast
  • 41,341
  • 63
  • 198
  • 344
11
votes
1 answer

dynamically update Libphonenumber metadata in pre-installed Android app

I have an android application that uses libphonenumber by Google and every time libphonenumber has a an update for area codes and carrier numbers "metadata" I have to literally re-package the application with newer version of the library and release…
Bassel Mourjan
  • 3,604
  • 3
  • 26
  • 37
9
votes
4 answers

How to use Google libphonenumber in Typescript?

I want to use Google libphonenumber in my angular project using Typescript. I have searched a lot on the internet and found a lot of stuff but could not find anything that could serve my purpose. Most of the content available shows the code in…
Ashish Singh
  • 111
  • 1
  • 1
  • 2
1
2 3
15 16