• Sergiy (5/5/2015)


    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).

    https://github.com/googlei18n/libphonenumber

    Mapping Phone Numbers to carrier

    PhoneNumber swissMobileNumber =

    new PhoneNumber().setCountryCode(41).setNationalNumber(798765432L);

    PhoneNumberToCarrierMapper carrierMapper = PhoneNumberToCarrierMapper.getInstance();

    // Outputs "Swisscom"

    System.out.println(carrierMapper.getNameForNumber(swissMobileNumber, Locale.ENGLISH));

    Neat, you found the frontend code for parsing the strings into classes that can be used programatically.

    Which is a handy thing to have, since all those phone numbers in your contacts list are strings. Stored in contacts2.db. In a table called "data". So when you retrieve the string and go to dial it, you have a handy library turning it into a class, and then figuring out how to dial it based on where you are.