Rules for international phone numbers

Source: Internet
Author: User

There are often problems when it comes to roaming.

For example, domestic long-distance calls, fixed telephone dialing area code and so on. You need to add a 0086 prefix to a foreign country. So what exactly is the situation?

Roaming, leaving its own registered service area, moving to another area, mobile communications can still provide it with the functionality of the service. Between regions or countries that require a network-compatible and already networked domestic city or have signed a bilateral roaming agreement.

First talk about mobile phones, the general now is the opening of the domestic long-distance (PHS has been abolished). But the need to add international identification code, such as a attribution to China for 18699998888 of the phone to call Macau +85366224209 (perhaps I was mistaken), then dial +853 directly plus the number on the back of Macau can be. Macau calls China in front of the phone number to add +86 on it. What is "+", according to Wikipedia, can use the "+" number to replace the local country (you in which country or region to call the code of International calls), such as in China or Europe is generally 00, and in North America is 1,gsm 00 and 1 made a mark directly with "+" to replace, This can be identified by operators in areas that support the GSM format. Because the operator is doing this call transfer service. CDMA I haven't thought about it yet.

Google as a global company to provide a libphonenumber jar package, on GitHub has its open source project, introduced a variety of formats, easy to use. You can also do things together with the SIM information provided by Android's own Telephonymanager class. For example, get SIM registered address (base station location) and country code, carrier information and so on.

The Global telecommunication organization has made some efforts to standardize, but because of the long-term market development, there are still some other formats. At present the more famous is the E164 format, is I above the similar +8613555556666 and so on. There are other possible middle plus "-" and so on.

  

Phonenumberutil Phoneutil == (Telephonymanager) Context.getsystemservice (context.telephony_service); Try {            = Tm.getnetworkcountryiso ();  The Country code of the network operator that returned the SIM card registration        Phonenumber.phonenumber numberproto = Phoneutil.parse (incomingnumber , Networkiso.touppercase (Locale.english));             = Phoneutil.format (Numberproto, PhoneNumberUtil.PhoneNumberFormat.E164);

This is a simple code that gets the E164 number after the call number is formatted.

  

Rules for international phone numbers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.