• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Frequently Asked Questions (FAQ)
2
3## <a href="#parsing">Parsing</a>
4
5### <a href="#country_code_not_removed">Why wasn't the country code removed when parsing?</a>
6
7In some cases, the library cannot tell if the leading digits of a phone number
8are intended to be the country calling code, or the start of the national
9significant number.
10
11This affects primarily German and Indonesian phone numbers, where country
12calling code (49 and 62 respectively) is also a valid area code, and numbers of
13variable lengths are valid. The leading digits will only be interpreted as a
14country calling code if the number is not already considered a possible number
15for the region provided when parsing.
16
17If you know that your numbers are always in the form &lt;country calling
18code&gt;&lt;national significant number&gt;, it is safe to put a "+" in front to
19indicate this to the library.
20
21### <a href="#non_digits">Why does the library treat some non-digit characters as digits?</a>
22
23When parsing, the library does its best to extract a phone number out of the
24given input string. It looks for the phone number in the provided text; it
25doesn't aim to verify whether the string is *only* a phone number.
26
27If the input looks like a vanity number to the library, `parse()` assumes this
28is intentional and converts alpha characters to digits. Please read the
29documentation for `PhoneNumber parse(String, String)` in
30[PhoneNumberUtil](http://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java)
31for details. Also see `Iterable<PhoneNumberMatch> findNumbers(CharSequence,
32String)`.
33
34Some examples:
35
36*   `+1 412 535 abcd` is parsed the same as `+1 412 535 2223`.
37
38*   If someone mistypes and adds an extra alpha character in the *middle*,
39    then the library assumes this was a mistake and fixes it. E.g. the extra `c`
40    in `+1 412 535 c0000` is ignored, and this is parsed the same as `+1 412 535
41    0000`.
42
43*   If someone mistypes and *replaces* a digit in the middle with an alpha
44    character, and the remaining characters do not make up a valid number, this
45    alpha character is not converted and the resulting number is invalid, e.g.
46    with `+1 412 535 c000`.
47
48
49### <a href="#prefix_not_removed">Why wasn't the national prefix removed when parsing?</a>
50
51Usually, when parsing, we remove a country's national or trunk prefix, so we can
52store a normalized form of the number. This is usually, but not always, a
53leading zero. In some situations, we don't remove this, but instead keep it as
54part of the national number:
55
561.  If a country does not use a national prefix, or does not use one anymore, we
57    don't remove a leading zero, since then if the user wanted to format the
58    number we would never know to prefix it with this leading zero.
591.  If the leading zero is not a national prefix but is needed for dialling from
60    abroad (e.g. in the case of Italy) it is stored in the proto, not removed as
61    a national prefix.
621.  If the number is too short to be a valid phone number in this country, we do
63    not remove the national prefix. For instance, although `0` is a national
64    prefix in Australia, we do not remove it from the number `000` which is the
65    emergency number; if we did we would not know that it needs a `0` re-added
66    when formatting since other short-codes do not, and we would be irreparably
67    changing the phone number.
68
69### <a href="#parsing_idds">Why wasn't `00` parsed the same as `+`?</a>
70
71`00` is not an international prefix (IDD) in every region, so it's not
72equivalent to `+`.
73
74For example, if [parsing `0015417540000` as if dialled from the
75US](http://libphonenumber.appspot.com/phonenumberparser?number=0015417540000&country=US),
76the national number is `15417540000` because `00` is not an international prefix
77in the US.
78
79Ascension Island, however, does have `00` as an international prefix, so `00`
80there works the same as `+` and [`0015417540000` as if dialled from
81`AC`](http://libphonenumber.appspot.com/phonenumberparser?number=0015417540000&country=AC)
82gives `5417540000` for the national number.
83
84You can try [the demo](http://libphonenumber.appspot.com/) for more regions.
85Also see `internationalPrefix` in
86[`resources/PhoneNumberMetadata.xml`](http://github.com/google/libphonenumber/blob/master/resources/PhoneNumberMetadata.xml).
87
88## <a href="#validation">Validation and types of numbers</a>
89
90### <a href="#possible_vs_valid">What is the difference between isPossibleNumber and isValidNumber?</a>
91
92To understand the behavior of functions, please refer to the documentation in
93the Javadoc/C++ header files. For example, see `isPossibleNumberWithReason` in
94[`PhoneNumberUtil`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java).
95
96### <a href="#short_numbers">Why does PhoneNumberUtil return false for valid short numbers?</a>
97
98Short numbers are out of scope of
99[`PhoneNumberUtil`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java).
100For short numbers, use
101[`ShortNumberInfo`](https://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/ShortNumberInfo.java).
102
103### <a href="#what_is_valid">What does it mean for a phone number to be valid?</a>
104
105Our phone number library can tell that a number range is valid when there is
106sufficient official documentation, with some latency after this fact is brought
107to our attention via issue reports or notifications (see below for more
108information on where our metadata comes from). A valid number range is one from
109which numbers can be freely assigned by carriers to users.
110
111Do not rely on libphonenumber to determine whether numbers are currently
112assigned to a specific user and reachable. Some products (e.g.
113[Google 2-step verification](https://www.google.com/landing/2step/)) do
114this with a verification step e.g. by sending an SMS or placing an automated
115phone call with a verification code). This is not technically feasible without
116such a verification step given the complicated international world we live in,
117with varying standardization practices in different regions.
118
119#### <a href="#why_not_valid">But my dialled number connected, so isn't it valid?</a>
120
121Not necessarily.
122
123*   In some countries extra digits at the end are ignored. For example, dialling
124    `1800 MICROSOFT` in the US connects to `+1 (800) MIC-ROSO`.
125*   During renumbering transitions, e.g. when all numbers are getting an extra
126    `9` added to the front, some operators will "fix" old numbers long after
127    they're no longer working for the majority.
128*   Numbers that are only locally-diallable e.g. a 7-digit number dialled in the
129    US are not valid, because without the rest of the number it is impossible
130    for the library to canonicalize this.
131
132### <a href="#isvalidnumberforregion">When should I use isValidNumberForRegion?</a>
133
134Rarely! Many people have phone numbers that do not belong to the country they
135live in. This applies particularly to mobile numbers, but may also be true
136for VoIP numbers etc. Note also that the regions your application supports may
137not be the same as the regions we support. For example, the Channel Islands such
138as "Jersey" have their own region code - JE. If you allow these users to sign up
139as a British user ("GB"), their phone numbers will not be considered valid for
140the region "JE".
141
142One use-case where this method may be useful is if you want to see if a
143`FIXED_LINE` number for a business matches the country it is in, to try and spot
144data errors.
145
146### <a href="#incorrect_formatting">Some "valid" numbers are not formatting correctly.</a>
147
148This could be due to number simplification. In order to keep the size of the XML
149files to a reasonable level, it's necessary in some regions (e.g. "DE" or "AT")
150to simplify number ranges. This results in a relatively small amount of false
151positive numbers (i.e. numbers that should be reported as invalid, but which are
152now shown as valid).
153
154This issue here is that (for simplicity) only the number validity information is
155simplified; the formatting information in the XML (leading digits) retains its
156full accuracy and so doesn't cover these numbers.
157
158Note that while it is probably possible to address this and expand the format
159information to cover these numbers as well, it's a rather non-trivial task
160(since the leading digits must not be over simplified so as to capture other
161valid ranges with different formats). Note that this also applies to attributes
162like "national only" or geocoding information.
163
164### <a href="#sms_sending">What types of phone numbers can SMSs be sent to?</a>
165
166SMSs can be sent to `MOBILE` or `FIXED_LINE_OR_MOBILE` numbers. However,
167in some countries it is possible to configure other types, such as normal
168land-lines, to receive SMSs.
169
170### <a name="#fixed_line_or_mobile">Why did I get `FIXED_LINE_OR_MOBILE` as the type of my phone number?</a>
171
172Some number ranges are explicitly defined as being for fixed-line or mobile
173phones. We even represent ranges defined as being "Mostly land-line" in this
174way.
175
176### <a name="#portability">What is mobile number portability?</a>
177
178The ability to keep your mobile phone number when changing carriers. To see whether a region supports mobile number portability use [isMobileNumberPortableRegion](https://github.com/google/libphonenumber/blob/58247207903f917839001bc62525a5b48a475b7e/java/libphonenumber/src/com/google/i18n/phonenumbers/PhoneNumberUtil.java#L3524).
179
180### <a name="#carrier_changes">Since it's possible to change the carrier for a phone number, how is the data kept up-to-date?</a>
181
182Not all regions support mobile number portability. For those that don't, we return the carrier when available. For those that do, we return the original carrier for the supplied number.
183
184### <a name="#m2m">What about M2M (machine to machine) numbers?</a>
185
186libphonenumber does not support M2M numbers in general, but only in one exception case where in Netherlands 097X M2M numbers are used as regular mobile phone numbers.
187
188The reason for Libphonenumber to not provide M2M support is related to the lack of standardization and the need for a new Util API (not in radar for the time being).
189
190We don't require that a number to be supported by the library has a human at the other end since we already accept premium rate services and they might go to an automated system instead. But to date we only accept ranges that a human might call or send an SMS to.
191
192M2M numbers would violate this assumption and we'd have to evaluate the consequences for existing APIs and clients if M2M numbers would be considered  valid by the library. Clients of libphonenumber expect mobile and fixed-line numbers to have certain affordances, such as: Reachable for voice calls (and for mobile also SMS) as well as assuming standard cost. This expectation is broken by the lack of M2M standardization today.
193
194Many people use this library for formatting the numbers of their contacts, for allowing people to sign up for services, for working out how to dial someone in a different country, for working out what kind of cost might be associated with a number in an advert, etc. We don't think the lack of M2M support hinders any of those use-case, but we might be wrong.
195
196At the moment Libphonenumber can only support phone numbers that can be dialled by us, not by machines. If you found any humanly diallable M2M numbers that library is not supporting, please raise an [issue here](http://issuetracker.google.com/issues/new?component=192347) with all authoritative and specific documentation such as government sources, which have varied definitions.
197
198### <a href="#why_only_nl_m2m">Why supporting only NL M2M numbers?; Are we sure all 097X numbers are MOBILE?</a>
199
200Official authority has [explicitly stated](https://www.acm.nl/en/publications/information-about-dutch-097-numbers-non-dutch-providers) that this range “should be made accessible, just like other, regular number series from the Netherlands” and that “you can set up a voice and SMS connection towards prefix +31-97 in the same way as you have done already with the +31-6 series.[...] you should enable your systems for voice telephony for the numbers
201in the +31-97 series”. This means, however, that there might be cases where the library would categorise a number as a valid mobile number, but in reality, the particular number is used as pure M2M, is not SMS or voice-enabled. There is not much we can do from our side about this, since we always follow official guidelines.
202
203Therefore, clients should be aware that there is possibility of false positives in NL MOBILE category. The library will continue to not support M2M numbers in general.
204
205### <a href="#operator_specific_numbers">What about numbers that are only valid for a set of subscribers?</a>
206
207There are some numbers that only work for the subscribers of certain operators
208for special operator-specific services. These differ from carrierSpecific since
209they're not shortcodes. We don't support these numbers due to their limited use
210scope, few examples (only the [area code 700](https://en.wikipedia.org/wiki/Area_code_700)
211in the US), and lack of authoritative evidence.
212
213Until there are more examples with authoritative evidence and a proposal on how
214the library should handle these numbers, we won't be able to support these
215similar to our prerequisites for supporting M2M.
216
217Please see [this issue](https://issuetracker.google.com/issues/65238929) for more
218context, and file a new issue if you're able to provide more information than this.
219
220## <a name="#representation">Representation</a>
221
222### <a name="#max_length">What is the maximum and minimum length of a phone number?</a>
223
224We support parsing and storing numbers from a minimum length of two digits to a
225maximum length of 17 digits currently (excluding country calling code). The ITU
226standard says the national significant number should not be longer than
227fifteen digits, but empirically this has been proven not to be followed by all
228countries.
229
230## <a name="#formatting">Formatting</a>
231
232### <a name="#language_specific_format">Can / should we format phone numbers in a language-specific way?</a>
233
234No, phone number formatting is country-specific and language-independent. E.g.
235formatting a US number in a French way (e.g. the way a France number is
236formatted) for a French user is undefined and wrong.
237
238It is true that in some countries phone numbers are typically written using
239native, not ASCII, digits; our phone number library supports parsing these but
240doesn't support it at formatting time at the moment.
241
242### <a href="#changes_in_formatting">When does formatting in a country change?</a>
243
244The formatting within a country changes sparingly, but may be announced explicitly
245or noted implicitly in a national numbering plan update that introduces a new number
246length, number type, or other significant change. This may include the grouping and
247punctuation used (e.g. parentheses versus hyphens).
248
249In the event of lack of evidence and/or enforcement by a central government
250regulatory or telecommunication authority, we'll stick with the status quo
251since the community prefers to bias towards stability and avoid flip-flopping
252between formats over time. If the silent majority becomes vocal to support
253new formatting with authoritative evidence, then we'll collaborate with
254community stakeholders on a transition.
255
256An example of this is the shift from using parentheses to hyphens to separate
257area codes within North America. Hyphens may indicate that the area code is
258optional in local circumstances, but this is shifting to become mandatory
259in areas that have had more area code splits. However, the usage of
260parentheses persists and both methods are acceptable.
261
262See [issue #1996](https://github.com/google/libphonenumber/issues/1996)
263for some additional discussion.
264
265### <a name="#empty_format_result">Why does formatNumberForMobileDialing return an empty string for my number?</a>
266
267If we don't think we can guarantee that the number is diallable from the user's
268mobile phone, we won't return anything. This means that for numbers that we
269don't think are internationally diallable, if the user is outside the country
270we will return an empty string. Similarly, in Brazil a carrier code is essential
271for dialling long-distance domestically. If none has been provided at parsing
272time then we will return an empty string. If you get an empty string and are
273okay providing a number that may not be diallable, you can call another of our
274formatting numbers instead.
275
276## <a name="#metadata">Metadata</a>
277
278### <a name="#metadata_definition">What do we mean by "metadata"?</a>
279
280We use the word "metadata" to refer to all information about phone numbering in
281a particular country - what the country code, international and national
282dialling prefixes are, what carrier codes are operational, which phone numbers
283are possible or valid for a particular country, how to optimally format them,
284which prefixes represent a particular geographical area, etc.
285
286### <a name="#metadata_sources">Where do we get information from to determine if a number range is valid?</a>
287
288In theory, phone numbering plans are all supposed to be administered through the
289ITU. Many countries' phone numbering plans may be found on the [ITU website](
290http://www.itu.int/oth/T0202.aspx?parent=T0202).
291
292We receive automatic notifications when a new ITU plan has been filed, which may
293or may not be before it comes into effect.
294
295Not every country files their numbering plans with the ITU nor are the plans
296filed with ITU always up to date. In some countries, the numbering plans are
297directly handled by a government authority, while in others, most of the work
298is done by telecom companies (the government's role being only to distribute
299ranges at the prefix level, with the actual partitioning within the prefix done
300by the telecom).
301
302A large part of the data in `PhoneNumberMetadata.xml` comes from the ITU
303documents, but because they're sometimes insufficient, we also include data from
304other sources, including user bug reports, telecom company home pages and
305government telecommunication authorities.
306
307There is no RFC indicating where the data comes from, or what format they're in.
308
309We'd love to consume machine-readable numbering plan data (assigned ranges,
310carrier & geo mappings). If you can connect us with partners in the industry
311to achieve this, please do so. Thanks!
312
313### <a name="#mx_and_ar">Why is this number from Argentina (AR) or Mexico (MX) not identified as the right number type?</a>
314
315Certain countries' mobile and/or fixed line ranges may overlap or too granular,
316which may make accurate identification impossible. Eg: Argentina and Mexico.
317We tried incorporating such granular data (prefix of 7 digit for a 10 digit
318number). However, due to very high maintainance to keep the data fresh and
319also leading to significant increase in metadata size, we are supporting
320ranges/prefixes only at higher level. More details in [Argentina](https://issuetracker.google.com/issues/78443410) and
321[Mexico](https://issuetracker.google.com/issues/74517266) triaged issues.
322
323@Argentina,
324When calling a mobile line from a fixed line in Argentina, you need
325to dial 15 before the subscriber number, or 9 if you're calling from another
326country. Without these additional digits, your call may not connect at all!
327
328We rely on these additional and explicit context such as a mobile prefix to
329correctly identify the phone number type (rather than returning [`FIXED_LINE_OR_MOBILE`](#fixed_line_or_mobile)
330in ambiguous cases).
331
332Moreover, Argentina has different possible lengths for area codes and
333subscriber numbers depending on the city, which further complicate matters (e.g.
334Buenos Aires is 11 followed by eight digits, but Río Gallegos is 2966 followed
335by six digits).
336
337Despite all the aforementioned complexity, users may not provide their phone
338number with all the additional context unless explicitly asked. For instance,
339since SMS messages can be sent in Argentina from a mobile phone without a
340prefix, the user may not supply the mobile prefix.
341
342We are aware of these issues but fixing them is not trivial. In the meantime, we
343recommend the following workarounds to support affected users.
344
345*   If you know an Argentina number is mobile (e.g. if you're doing signups with
346    device numbers or will send them an SMS verification code), follow these steps:
347    *   For raw input strings:
348        *   Parse a raw input string into a `PhoneNumber` and follow the next
349            instructions for `PhoneNumber` objects.
350    *   For `PhoneNumber` objects:
351        *   Check that the library validates a `PhoneNumber` as mobile, by
352            calling `getNumberType`;
353        *   If not, format it in national format and prepend a `9`
354        *   Parse the modified string and if the library validates it as mobile,
355            accept the resulting `PhoneNumber` as canonical.
356*   Consider prompting for type (mobile or not) in the phone number input UI.
357
358IMPORTANT: Do not add a leading 9 for displaying or formatting the numbers.
359Depending on the use case, other tokens may be needed. The library will do the
360right thing if the phone number object is as intended.
361
362@Mexico,
363Mexico used to have such additional prefixes (1, 02, 045, ...) for dialling
364mobile numbers internationally, fixed-line to mobile nationally.. As these
365dialling patterns were deprecated, we have continued to maintain mobile and
366fixed-line ranges at higher level, returning type as [`FIXED_LINE_OR_MOBILE`](#fixed_line_or_mobile)
367
368### <a href="#mx_legacy_formats">Why Mexico (MX) numbers in older dialling formats are accepted as valid ones?</a>
369Though library has stopped supporting below older dialling codes in the canonical
370form and formatting results, we are lenient in parsing the number, i.e removing
371all older codes.
372- 1 -> in E.164 international diallings
373- 01, 02, 044 and 045 -> for local/national diallings
374
375This is because we found the older dialling codes supported even after deprecation
376period, so we decided to support them for longer time. However, we will stop this as
377part of [this issue](https://issuetracker.google.com/issues/205606725). More details there.
378
379### <a name="#unsupported_regions">Why are Bouvet Island (BV), Pitcairn Island (PN), Antarctica (AQ) etc. not supported?</a>
380
381We only support a country if:
382
383*   **The country has a single country calling code.** For instance, Kosovo (XK)
384    has been using three different country codes until 2017 - those of Serbia,
385    Monaco and Slovenia. The relevant numbers will be marked as valid, but as
386    belonging to Serbia, Monaco or Slovenia respectively. When Kosovo starts
387    using its own country calling code of 383 it will be added to the metadata
388    by itself. Similarly, Antarctica doesn't use its assigned country calling
389    code of 672 - instead the bases belonging to different countries have
390    different solutions. For example, Scott Base, belonging to New Zealand, has
391    an area code that is part of the New Zealand phone number plan, and we
392    support those numbers as valid numbers for NZ.
393*   **The country still exists.** For example, Yugoslavia (YU), Serbia and
394    Montenegro (CS) and Netherlands Antilles (AN) have been dissolved and no
395    longer exist as political entities so we do not support them.
396*   **The country has some phone numbers in use that can be ascribed to it.**
397    For instance, Pitcairn Island has only around thirty inhabitants and they
398    use satellite phones, so there is no numbering plan for Pitcairn Island.
399    Similarly, Bouvet Island is an uninhabited Antarctic volcanic island with no
400    telephone country code and no telephone connection, so we will not support
401    it.
402*   **It has an assigned region code.** For instance, previously Kosovo did not
403    have a region code assigned to it, so we could not support it until it was
404    assigned XK by [CLDR](http://cldr.unicode.org/).
405
406We support non-geographical entities that have been assigned country calling
407codes by the ITU where a numbering plan is available, e.g. "800" (International
408Freephone Service) and 870 (Inmarsat SNAC). However we do not support country
409calling codes that are only "reserved", or that no data is available for (namely
410388 - listed as "Group of countries, shared code" and 991 - listed as "Trial of
411a proposed new international telecommunication public correspondence service,
412shared code".)
413
414### <a name="#indonesia_tollfree">Why are Indonesian toll-free numbers beginning with "00x 803" not supported?</a>
415
416Although some numbers beginning with "001 803" or "007 803" do work in Indonesia
417to reach toll-free endpoints, these numbers are hard to support because they
418overlap with the international dialling prefix for Indonesia (IDD). It seems
419that since 803 is unassigned and not a valid country code, some local
420tel-companies in Indonesia hijack 803 and redirect it to their own services.
421
422We have also found evidence that reaching some "00x 803" numbers cost local or
423national tariff, rather than the call being toll-free.
424
425These numbers are not diallable from any other country using their IDD,
426and it's unclear whether all carriers in Indonesia support them. If we ever
427supported them, they would have to be added to the `noInternationalDialling`
428section, and it is likely some changes in the parsing code would have to be
429made to interpret the "00x" as something other than an IDD: this could have
430undesirable side-effects when parsing other numbers.
431
432## <a name="#misc">Misc</a>
433
434### <a name="#reduced_metadata">What is the metadatalite.js/METADATA_LITE option?</a>
435
436For JavaScript, Java and C++ there is the option to use a stripped-down version
437of the metadata. Currently this only removes the example number metadata, so the
438savings are not a lot, but we may revisit this.
439
440*Impact:*
441
442-   `getExampleNumber`, `getInvalidExampleNumber`, `getExampleNumberForType`,
443     `getExampleNumberForNonGeoEntity` will return `null`
444-   Binary size (or download size for JS) will be slightly smaller
445
446*JS:*
447Simply include metadatalite.js instead of metadata.js in your project.
448
449*C++:*
450Set the compiler flag `USE_METADATA_LITE` to `ON` using ccmake or similar.
451
452*Java:*
453The metadata binary files can be generated using the ant build rules
454`build-phone-metadata` and `build-short-metadata` with `lite-build` set to
455`true`. This can be set in the [build
456file](https://github.com/google/libphonenumber/blob/master/java/build.xml)
457itself.
458
459### <a name="#maven">Which versions of the Maven jars should I use?</a>
460
461When possible, use the [latest
462version](https://github.com/google/libphonenumber/releases) of
463libphonenumber.
464
465For the other Maven artifacts, to find the version corresponding to a given
466version of libphonenumber, follow these steps:
467
468*   Go to the versioned GitHub tag, e.g.
469    https://github.com/google/libphonenumber/find/v8.3.3
470*   Type `pom.xml`. This will surface all the `pom.xml` files as they were
471    released at the chosen tag.
472*   Find the version you care about in the corresponding `pom.xml` file. Look
473    for `<version>` in the top-level `project` element. For example, to find the
474    version of the carrier jar corresponding to libphonenumber 8.3.3, open
475    `java/carrier/pom.xml` at v8.3.3's search results. This is `1.56`.
476*   If you depend on the carrier or geocoder jar, you also need to depend on
477        the prefixmapper jar.
478
479### <a name="#android">How do I load libphonenumber resources in my Android app?</a>
480
481#### System considerations
482
483tl;dr: Do not call `PhoneNumberUtil` API on the main thread.
484
485If you get surprising exceptions involving metadata loading, e.g. "missing
486metadata" exceptions when the metadata exists, then it's probably because you're
487loading resources on the main thread.
488
489Please ensure that you don't call `PhoneNumberUtil` API on the main thread. Not
490loading resources in the main thread is the suggested best practice at the
491[Android developer
492guide](http://developer.android.com/guide/components/processes-and-threads.html),
493and will prevent the issue reported in
494[#265](https://github.com/google/libphonenumber/issues/265),
495[#528](https://github.com/google/libphonenumber/issues/528), and
496[#819](https://github.com/google/libphonenumber/issues/819).
497
498#### Optimize loads
499
500You can manage your own resources by supplying your own
501[`MetadataLoader`](http://github.com/google/libphonenumber/blob/master/java/libphonenumber/src/com/google/i18n/phonenumbers/MetadataLoader.java)
502implementation to the `PhoneNumberUtil` instance. It is thus possible for your
503app to load the resources as Android assets, while libphonenumber loads Java
504resources by default. The result is that the files are read as native Android assets
505and so optimized for speed.
506
507Here's the sample code for how to do it:
508
509```
510PhoneNumberUtil util = PhoneNumberUtil.createInstance(new MetadataLoader() {
511  @Override
512  public InputStream loadMetadata(String metadataFileName) {
513    return Application.getContext().getAssets().open("some/asset/path" + metadataFileName);
514  }
515});
516```
517
518You also need to copy the binary metadata files into your app's asset directory, and
519automate updating them from upstream. To avoid net increase of app size, remove them
520from libphonenumber.
521
522### <a name="#windows">What about Windows?</a>
523
524The libphonenumber team's support of the C++ library on Windows is primarily to
525support Chromium's build environment, and we depend on the community to support
526other Windows build environments / build chains. We list here some known issues
527that would benefit from open-source collaboration. If you can contribute a PR
528or review and test out someone else's PR, please chime in on these links, or
529email the [discussion
530group](https://groups.google.com/group/libphonenumber-discuss):
531
532*   [#1000](https://github.com/google/libphonenumber/issues/1000) to provide
533    a Windows DLL.
534*   [#1010](https://github.com/google/libphonenumber/issues/1010) to require
535    Visual Studio 2015 update 2 or later on Windows
536*   PR [#1090](https://github.com/google/libphonenumber/pull/1090) /
537    [#824](https://github.com/google/libphonenumber/issues/824) to "Replace
538    POSIX directory operations by Boost Filesystem"
539*   [#1555](https://github.com/google/libphonenumber/issues/1555) to allow
540    Windows to build cpp library with pthreads for multi-threading
541
542### <a name="#remove_example_number">How to remove a specific example number</a>
543
544We supply example numbers as part of the library API. While we aim to have numbers
545that are either explicitly allocated by the country as a test number, or look
546fictitious (e.g. 1234567) we also need these numbers to validate correctly.
547This means we sometimes have numbers that do connect to a real person.
548
549If we by chance have actually listed your real number and would like it removed,
550please report this through Google's new [Issue Tracker](http://issuetracker.google.com/issues/new?component=192347).
551Only our internal team will have access to your identity (whereas GitHub usernames are public).
552
553### <a name="#long_numbers_in_js">Why can the smallest digits of parsed numbers that are very long be incorrect when parsing in Javascript?</a>
554
555Eg: National number of 900184080594493**87**, ```region: JP``` is parsed as
556900184080594493**90**. Reason: When the provided number is more than the max
557limit of JavaScript ```Number``` type - 2^53, JS starts rounding the value.
558libphonenumber cannot do anything better here. More details mentioned [in this issue](https://issuetracker.google.com/issues/198423548).
559