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
29
votes
7 answers

Android get all contacts telephone number in ArrayList

I am trying to save all contacts telephone numbers in an ArrayList but I cant find a way how. Is there a way to get them instead of picking them one by one with ContactsContract?
Karl-John Chow
  • 775
  • 2
  • 8
  • 26
28
votes
10 answers

How to change Phone number format in input as you type?

My CodePen: http://codepen.io/leongaban/pen/cyaAL I have an input field for a phone number which allows up to 20 characters (for international numbers). I'm also using the Masked input jQuery plugin by Josh Bush to format the phone number in the…
Leon Gaban
  • 36,509
  • 115
  • 332
  • 529
27
votes
2 answers

Is there a standard for phone numbers?

Before you say that this has already been asked, know that I've already reviewed these: Is there a standard for storing normalized phone numbers in a database? - This is from 2008, and says that, at the time, there was no such standard. I'm hoping…
Ky -
  • 30,724
  • 51
  • 192
  • 308
25
votes
14 answers

Regular Expression Validation For Indian Phone Number and Mobile number

I want to validate Indian phone numbers as well as mobile numbers. The format of the phone number and mobile number is as follows: For land Line number 03595-259506 03592 245902 03598245785 For mobile number 9775876662 0 9754845789 0-9778545896 +91…
Iswar
  • 2,211
  • 11
  • 40
  • 65
23
votes
4 answers

phone number should be a string or some numeric type that have capacity to save phone number?

We want to store 10 digit mobile number i.e.9999999999. Should it be numeric or string datatype? We don't want to do any calculative or manipulation operation on this Which is better memory and performance wise?
Sahil Sharma
  • 3,847
  • 6
  • 48
  • 98
23
votes
3 answers

How do you store cell phone numbers in a database?

With the age of text messages and things like that, what's a good way to store phone numbers in a database? In the USA, text messages are handled by phone numbers but in other countries I hear they use email addresses so I guess there needs to be a…
danmine
  • 11,325
  • 17
  • 55
  • 75
23
votes
10 answers

Convert php array to csv string

I have several method to transform php array to csv string both from stackoverflow and google. But I am in trouble that if I want to store mobile number such as 01727499452, it saves as without first 0 value. I am currently using this piece of…
Pritom
  • 1,294
  • 8
  • 19
  • 37
22
votes
5 answers

Phone number normalization: Any pre-existing libraries?

I have a system which is using phone numbers as unique identifiers. For this reason, I want to format all phone numbers as they come in using a normalized format. Because I have no control over my source data, I need to parse out these numbers…
Dan Herbert
  • 99,428
  • 48
  • 189
  • 219
22
votes
1 answer

No activity found to handle intent action.dial

I'm trying to make my app call a number from an EditText, but I get: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.DIAL dat=Ring Tel nr. 123456789 } I've searched a while for an answer,…
21
votes
3 answers

Get country name from Country code in python?

I have worked with 2 python libraries: phonenumbers, pycountry. I actually could not find a way to give just country code and get its corresponding country name. In phonenumbers you need to provide full numbers to parse. In pycountry it just get…
Alireza
  • 6,497
  • 13
  • 59
  • 132
21
votes
5 answers

How do you format a 10 digit string into a phone number?

I have database records in the form of 10 character long strings, such as 4085551234. I wish to format these into this format: (408) 555-1234. I think this is regex related. I'm new to programming and completely self-taught here, so any sort of…
dmanexe
  • 1,034
  • 4
  • 16
  • 40
20
votes
6 answers

Validate Mobile Number using Hibernate annotation

I have a entity called User and I want to validate a mobile number field The mobile number field is not mandatory it can be left blank but it should be a 10 digit number. If the user enters any value less then 10 digits in length then an error…
Ankur Raiyani
  • 1,509
  • 5
  • 21
  • 49
19
votes
10 answers

Phone Number Columns in a Database

In the last 3 companies I've worked at, the phone number columns are of type varchar(n). The reason being that they might want to store extensions (ext. 333). But in every case, the "-" characters are stripped out when inserting and updating. I…
rkg
19
votes
4 answers

Regular Expression for finding phone numbers

Possible Duplicates: A comprehensive regex for phone number validation grep with regex for phone number Hello Everyone, I am new to Stackoverflow and I have a quick question. Let's assume we are given a large number of HTML files (large as in…
Rocky
  • 191
  • 1
  • 1
  • 3
19
votes
3 answers

Get phonenumber programmatically - Android

is it possible to get the phonenumber of each device programmatically? I tried this code: TelephonyManager manager =(TelephonyManager)mAppContext.getSystemService(Context.TELEPHONY_SERVICE); mPhoneNumber = manager.getLine1Number(); This works fine…
JavaForAndroid
  • 1,111
  • 2
  • 20
  • 42
1 2
3
81 82