Which is best data type for phone number in MySQL and what should Java type mapping for it be?

Strings & VARCHAR. Do not try storing phone numbers as actual numbers. it will ruin the formatting, remove preceding 0s and other undesirable things. You may, if you choose to, restrict user inputs to just numeric values but even in that case, keep your backing persisted data as characters/strings and not numbers. Be aware of … Read more

Regular Expression Validation For Indian Phone Number and Mobile number

For land Line Number 03595-259506 03592 245902 03598245785 you can use this \d{5}([- ]*)\d{6} NEW for all 😉 OLD: ((\+*)(0*|(0 )*|(0-)*|(91 )*)(\d{12}+|\d{10}+))|\d{5}([- ]*)\d{6} NEW: ((\+*)((0[ -]*)*|((91 )*))((\d{12})+|(\d{10})+))|\d{5}([- ]*)\d{6} 9775876662 0 9754845789 0-9778545896 +91 9456211568 91 9857842356 919578965389 03595-259506 03592 245902 03598245785 this site is useful for me, and maby for you .;)http://gskinner.com/RegExr/

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

You can use the TelephonyManager to do this: TelephonyManager tm = (TelephonyManager)getSystemService(TELEPHONY_SERVICE); String number = tm.getLine1Number(); The documentation for getLine1Number() says this method will return null if the number is “unavailable”, but it does not say when the number might be unavailable. You’ll need to give your application permission to make this query by adding … Read more

What’s the longest possible worldwide phone number I should consider in SQL varchar(length) for phone

Assuming you don’t store things like the ‘+’, ‘()’, ‘-‘, spaces and what-have-yous (and why would you, they are presentational concerns which would vary based on local customs and the network distributions anyways), the ITU-T recommendation E.164 for the international telephone network (which most national networks are connected via) specifies that the entire number (including … Read more