Questions tagged [phone-number]

A telephone number or phone number is a sequence of digits used to call from one telephone line to another in a public switched telephone network(PSTN). When telephone numbers were invented, they were short — as few as one, two or three digits — and were given orally to a switchboard operator. As phone systems have grown and interconnected to encompass the world, telephone numbers have become longer.

A telephone number or phone number is a sequence of digits used to call from one telephone line to another in a public switched telephone network. When telephone numbers were invented, they were short — as few as one, two or three digits — and were given orally to a switchboard operator. As phone systems have grown and interconnected to encompass the world, telephone numbers have become longer. In addition to telephones, they now access other devices, such as computers and fax machines.

Telephone numbers must not be stored using numerical data types.

The format of telephone numbers internationally follows ITU-T Recommendation E.164, described here.

This is a useful reference for people creating software to handle telephone numbers: Falsehoods Programmers Believe About Phone Numbers.

1228 questions
67
votes
23 answers

Phone number formatting on iOS

I have a text field where the user enters data. It's a phone number field. If the user enters 1234567890, I want it displayed as (123)-(456)-7890 as the user types. How is this possible?
Moni Viki
  • 949
  • 1
  • 14
  • 20
63
votes
9 answers

What's the right way to represent phone numbers?

I'm having trouble representing a mobile number in one of my applications. I was wondering if there is an Integer class that will allow you to store such a number starting with 0417254482. Perhaps using a string be a more appropriate? At present…
user420344
  • 633
  • 1
  • 5
  • 4
57
votes
6 answers

International phone number max and min?

What is the max and min digits for an international telephone number? (country code + area code + phone number)
001
  • 62,807
  • 94
  • 230
  • 350
55
votes
8 answers

How do I include extensions in the tel: URI?

I currently have a webpage serving up phone numbers, some of these phone numbers have extensions so I have written the HTML like this: +44-1234-56788 / +44-1234-56799
Jarede
  • 3,310
  • 4
  • 44
  • 68
54
votes
6 answers

Android: Retrieve contact name from phone number

I would like to retrieve the name of a contact associated with an incoming telephone number. As I process the incoming number in the broascastreceiver having a String with the name of the incoming caller would help my project greatly. I would think…
Noah Seidman
  • 4,359
  • 5
  • 26
  • 28
52
votes
11 answers

mysql datatype for telephone number and address

I want to input telephone number in a form, including country code, extension create table if not exists employee( ` country_code_tel int(11), tel_number int(10), extension int(10), mobile …
SUN Jiangong
  • 5,242
  • 16
  • 57
  • 76
47
votes
5 answers

How to get current SIM card number in Android?

I want to know user mobile number in Android. I used this code but I'm not getting number. TelephonyManager tm = (TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE); String n = tm.getLine1Number(); Permission:
User
  • 1,251
  • 1
  • 14
  • 19
46
votes
10 answers

List of phone number country codes

On this Wikipedia entry I found out that ITU Telecommunication Standardization Sector (ITU-T) is providing such list of country calling codes. Here is a pdf: http://www.itu.int/dms_pub/itu-t/opb/sp/T-SP-E.164D-2009-PDF-E.pdf I wonder where to find…
jesperlind
  • 2,092
  • 2
  • 20
  • 22
46
votes
4 answers

libphonenumber standalone (without masses of google dependencies)? Alternate lib?

I am looking at using http://code.google.com/p/libphonenumber/ for a well-established project. Today the project does not use Google's libraries for JavaScript, favoring jQuery, jQueryUI, requirejs, and so on. libphonenumber looks awesome ... except…
S42
  • 1,061
  • 2
  • 10
  • 16
42
votes
9 answers

Mask US phone number string with JavaScript

I need regular express for US Phone Number format.I want to replace the phone number string into below US phone number string format in JavaScript. var number = "4031234789"; And I want to mask it in below format:- number = number.mask('(000)…
Pawan
  • 2,150
  • 11
  • 45
  • 73
38
votes
7 answers

What is the best way for converting phone numbers into international format (E.164) using Java?

What is the best way for converting phone numbers into international format (E.164) using Java? Given a 'phone number' and a country id (let's say an ISO country code), I would like to convert it into a standard E.164 international format phone…
Vihung
  • 12,947
  • 16
  • 64
  • 90
37
votes
6 answers

RegEx for valid international mobile phone number

I use Clickatell to send SMSes to clients' mobile phones. Is there a standardised regular expression for all valid mobile phone numbers, e.g. +27 123 4567? I'd roll my own, but I'm worried about missing an obscure, valid phone number format.
Petrus Theron
  • 27,855
  • 36
  • 153
  • 287
36
votes
6 answers

How to get the mobile number of current sim card in real device?

I have to make an application which shows the contact no of the SIM card that is being used in the cell. For that I need to use TelephonyManager class. Can I get details on its usage?
Narasimha
  • 3,802
  • 11
  • 55
  • 83
33
votes
3 answers

Remove dash from a phone number

What regular expression using java could be used to filter out dashes '-' and open close round brackets from a string representing phone numbers... so that (234) 887-9999 should give 2348879999 and similarly 234-887-9999 should give…
zoom_pat277
  • 1,214
  • 5
  • 15
  • 31
30
votes
6 answers

TelephonyManager.getLine1Number() failing?

I want to get phone number of android device. I use this code: TelephonyManager tm = (TelephonyManager)this.getApplicationContext().getSystemService(Context.TELEPHONY_SERVICE); String phoneNumber= tm.getLine1Number(); On my phone (HTC Wildfire) I…
knagode
  • 5,816
  • 5
  • 49
  • 65
1
2
3
81 82