Which Jar I Have To Download Google Libphonenumbers UPDATED
Which Jar I Have To Download Google Libphonenumbers
What is information technology?
Google's common Java, C++ and JavaScript library for parsing, formatting, and validating international phone numbers. The Coffee version is optimized for running on smartphones, and is used past the Android framework since four.0 (Ice Foam Sandwich).
Quick links
- Reporting an issue? Desire to send a pull request? See the contribution guidelines
- Check the frequently asked questions
- Fun! Falsehoods Programmers Believe Near Phone Numbers
- Look for
READMEdue south in directories relevant to the code yous're interested in. - For contributors and porters: How to run the Java demo
- For porters: How to make metadata changes
Highlights of functionality
- Parsing, formatting, and validating phone numbers for all countries/regions of the world.
-
getNumberType- gets the blazon of the number based on the number itself; able to distinguish Stock-still-line, Mobile, Toll-free, Premium Rate, Shared Cost, VoIP, Personal Numbers, UAN, Pager, and Voicemail (whenever viable). -
isNumberMatch- gets a confidence level on whether two numbers could exist the aforementioned. -
getExampleNumberandgetExampleNumberForType- provide valid case numbers for all countries/regions, with the choice of specifying which type of example phone number is needed. -
isPossibleNumber- rapidly guesses whether a number is a possible phone number past using only the length data, much faster than a full validation. -
isValidNumber- full validation of a phone number for a region using length and prefix information. -
AsYouTypeFormatter- formats phone numbers on-the-fly when users enter each digit. -
findNumbers- finds numbers in text. -
PhoneNumberOfflineGeocoder- provides geographical data related to a phone number. -
PhoneNumberToCarrierMapper- provides carrier information related to a phone number. -
PhoneNumberToTimeZonesMapper- provides timezone information related to a telephone number.
Demo
Java
The Coffee demo is updated with a slight delay afterward the GitHub release.
Last demo update: v8.12.44.
If this number is lower than the latest release's version number, nosotros are between releases and the demo may be at either version.
JavaScript
The JavaScript demo may be run at various tags; this link will take y'all to chief.
Java code
To include the Coffee code in your application, either integrate with Maven (see wiki) or download the latest jars from the Maven repository.
Javadoc
Javadoc is automatically updated to reflect the latest release at https://javadoc.io/doc/com.googlecode.libphonenumber/libphonenumber/.
Versioning and Announcements
We more often than not choose the release number following these guidelines.
If whatever of the changes pushed to master since the last release are incompatible with the intent / specification of an existing libphonenumber API or may cause libphonenumber (Java, C++, or JS) clients to accept to modify their lawmaking to keep building, we publish a major release. For example, if the last release were vii.7.3, the new i would exist 8.0.0.
If any of those changes enable clients to update their code to take advantage of new functionality, and if clients would have to ringlet-back these changes in the event that the release was marked as "bad", we publish a minor release. For instance, we'd go from vii.7.3 to 7.8.0.
Otherwise, including when a release contains merely metadata changes, we publish a sub-minor release, e.g. 7.7.iii to vii.7.iv.
Sometimes we brand internal changes to the code or metadata that, while not affecting compatibility for clients, could bear on compatibility for porters of the library. For such changes we make announcements to libphonenumber-hash out. Such changes are not reflected in the version number, and we would publish a sub-minor release if there were no other changes.
Want to get notified of new releases? During most of the year, excepting holidays and extenuating circumstances, we release fortnightly. We update release tags and document detailed release notes. We also send an announcement to libphonenumber-discuss for every release.
Quick Examples
Let'southward say y'all have a string representing a phone number from Switzerland. This is how you parse/normalize it into a PhoneNumber object:
String swissNumberStr = "044 668 xviii 00" ; PhoneNumberUtil phoneUtil = PhoneNumberUtil .getInstance(); try { PhoneNumber swissNumberProto = phoneUtil.parse(swissNumberStr, "CH" ); } catch (NumberParseException e) { Arrangement .err.println( "NumberParseException was thrown: " + e.toString()); } At this betoken, swissNumberProto contains:
{ "country_code": 41, "national_number": 446681800 } PhoneNumber is a grade that was originally machine-generated from phonenumber.proto with necessary modifications for efficiency. For details on the pregnant of each field, refer to resources/phonenumber.proto.
Now let us validate whether the number is valid:
boolean isValid = phoneUtil.isValidNumber(swissNumberProto); // returns true There are a few formats supported by the formatting method, as illustrated below:
// Produces "+41 44 668 18 00" System .out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat .INTERNATIONAL)); // Produces "044 668 eighteen 00" System .out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat .NATIONAL)); // Produces "+41446681800" System .out.println(phoneUtil.format(swissNumberProto, PhoneNumberFormat .E164)); You lot could also choose to format the number in the way information technology is dialed from another state:
// Produces "011 41 44 668 1800", the number when information technology is dialed in the United states. System .out.println(phoneUtil.formatOutOfCountryCallingNumber(swissNumberProto, "US" )); Formatting Phone Numbers 'as you type'
PhoneNumberUtil phoneUtil = PhoneNumberUtil .getInstance(); AsYouTypeFormatter formatter = phoneUtil.getAsYouTypeFormatter( "United states of america" ); Arrangement .out.println(formatter.inputDigit( '6' )); // Outputs "half dozen" ... // Input more digits System .out.println(formatter.inputDigit( '3' )); // Now outputs "650 253" Geocoding Phone Numbers
PhoneNumberOfflineGeocoder geocoder = PhoneNumberOfflineGeocoder .getInstance(); // Outputs "Zurich" Arrangement .out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale .English language)); // Outputs "Zürich" Organization .out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale .German)); // Outputs "Zurigo" System .out.println(geocoder.getDescriptionForNumber(swissNumberProto, Locale .ITALIAN)); Mapping Phone Numbers to original carriers
Caveat: We do not provide information near the current carrier of a phone number, only the original carrier who is assigned the respective range. Read almost number portability.
PhoneNumber swissMobileNumber = new PhoneNumber().setCountryCode(41).setNationalNumber(798765432L); PhoneNumberToCarrierMapper carrierMapper = PhoneNumberToCarrierMapper .getInstance(); // Outputs "Swisscom" Organization .out.println(carrierMapper.getNameForNumber(swissMobileNumber, Locale .ENGLISH)); More examples on how to apply the library can exist plant in the unit tests.
Third-party Ports
Several 3rd-party ports of the telephone number library are known to us. We share them hither in instance they're useful for developers.
All the same, we emphasize that these ports are by developers outside the libphonenumber project. We practise not evaluate their quality or influence their maintenance processes.
- C#: https://github.com/twcclegg/libphonenumber-csharp
- Go: https://github.com/nyaruka/phonenumbers
- Objective-c: https://github.com/iziz/libPhoneNumber-iOS
- PHP: https://github.com/giggsey/libphonenumber-for-php
- PostgreSQL in-database types: https://github.com/blm768/pg-libphonenumber
- Python: https://github.com/daviddrysdale/python-phonenumbers
- Ruby: https://github.com/mobi/telephone_number
- Rust: https://github.com/1aim/rust-phonenumber
- Erlang: https://github.com/marinakr/libphonenumber_erlang
- Clojure: https://github.com/randomseed-io/phone-number
- R: https://github.com/socialresearchcentre/dialr/
Alternatives to our own versions:
- Android-optimized: Our Coffee version loads the metadata from
Class#getResourcesAsStreamand asks that Android apps follow the Android loading best practices of repackaging the metadata and loading fromAssetManager#open()themselves (FAQ). If you don't want to practice this, check out the port at https://github.com/MichaelRocks/libphonenumber-android, which does repackage the metadata and employAssetManager#open up(), and may be depended on without needing those specific loading optimizations from clients. You should likewise check out the port at https://github.com/lionscribe/libphonenumber-android which also supports geocoding, and only requires a one line code modify. - Javascript: If you don't desire to use our version, which depends on Closure, at that place are several other options, including https://github.com/catamphetamine/libphonenumber-js - a stripped-down rewrite, about 110 KB in size - and https://github.com/seegno/google-libphonenumber - a browserify-compatible wrapper around the original unmodified library installable via npm, which packs the Google Closure library, near 420 KB in size.
DOWNLOAD HERE
Posted by: palmervern1978.blogspot.com
Post a Comment for "Which Jar I Have To Download Google Libphonenumbers UPDATED"