libphonenumber, why didn't I know this existed?


News: libphonenumber, why didn't I know this existed?

  1. libphonenumber, why didn't I know this existed? (7 messages)

    libphonenumber was mentioned on one or another site recently. I didn't know it was around, but it makes good sense. It's a library that parses, formats, validates, and stores phone numbers, which you might have been able to guess from the "libphonenumber" name.

    It comes in two flavors: java and javascript. The javascript version requires Google's closure library, and is just another javascript file. (Actually a set of files, but you get the idea: you include the phonenumberutil.js script and the google closure script, and you're off and running.)

    The Java version of the library is built with ant, so no maven repository version that I could find. That kinda sucks, but the library has a lot of stuff that's really neat: you can tell where a phone number's from, whether the number is valid or not, all kinds of stuff.

    The one thing is doesn't do is tell me what region goes with a US area code. I always have to look it up if it's not southern Illinois.

    Haven't tried the library on Android, either - anyone know if it works there? And why can't Android intercept incoming call events so I can intercept and display the region a call is from?

    Threaded Messages (7)

  2. Just to promote my friends company: on you can look up what region goes with an area code, among other things. Free for incidental use, but you need a subscription for the full info.

  3. Rather incomplete data[ Go to top ]

    The project's home page claims that the library is able to format and validate phone numbers in 180 countries and regions, so I decided to check out at least a few of them (particulary Germany and Norway) and the data quality was not particulary promising. The rules are partially incomplete, incorrect and seem to be missing number plan changes implemented several years ago.

  4. Incomplete data[ Go to top ]

    Data has been researched from:

    - ITU-T official documents (which in many cases appear to be very incomplete)

    - National telecoms regulator official documents (which appear often to be out of dateand/or full of errors)

    - Code lists found on sites such as Wikipedia (some of which are very up to date, and others which are horribly out of date - with very little clue as to which it might be)

    - online newspaper and other articles detailing numberplan changes.

    The vast majority of information on the web appears to be incomplete, out of date, and broken in many different ways.

    YOU can help by posting the complete, corrected, information somewhere and drawing attention to it.

  5. Updates[ Go to top ]

    Many of the data sources are noted in comments in the meta data file.

    If you have the ability to make updates to that source site to bring it up to date, then please do.

    Alternatively, you could suggest a different data source, one with more complete or more up-to-date data.

  6. Maven[ Go to top ]

    There has been a request (Issue 4) to add libphonenumber to Maven.


    No idea if that will happen or not, but it *is* being considered by those that are in a position to make it happen.

  7. New release 2010-01-20[ Go to top ]

    The java source for libphonenumber was today updated to rev 66. There are many changes and massive updates to the phone number metadata.

    The libphonenumber.jar file was today updated to ver 2.5 (replacing the ver 2.4 .jar file generated from libphonenumber source rev 59).

    The parallel javascript port is likely to be updated next week (though the current port is fairly recent at rev 63).


  8. libphonenumber for java 1.5[ Go to top ]

    From version 2.5.1 onwards the libphonenumber .jar file is compiled for Java 1.5 and above.

    Previous versions of libphonenumber were compiled for Java 1.6.

    There is a Javascript version in the SVN source, and a demo of it is available at


    There is also the beginnings of a port to C++, which should be completed in the next few months.

    Other people are working on ports to Ruby, PHP and Python.