Android Utililty Methods Phone Number Check

List of utility methods to do Phone Number Check

Description

The list of methods to do Phone Number Check are organized into topic(s).

Method

booleanisPhoneNumber(String inputStr)
is Phone Number
if (inputStr == null) {
    return false;
if (inputStr.startsWith("1") && inputStr.length() == 11) {
    return true;
return false;
booleanisPhone(String phoneNumber)
is Phone
String strPattern = "([0-9]{3,4}-)?[0-9]{4,12}";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(phoneNumber);
return m.matches();
booleanisPhoneNumber(final String phone)
is Phone Number
Pattern pattern = Pattern.compile(telNumRegex);
Matcher macther = pattern.matcher(phone.trim());
return macther.find() ? true : false;
booleanisTelNumAvailable(String telNum)
is Tel Num Available
boolean result = false;
if (!isNullOrEmpty(telNum)
        && telNum.matches("^1[3458]{1}[0-9]{9}$")) {
    result = true;
return result;
booleanisMobile(String mobiles)
is Mobile
Pattern p = Pattern
        .compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
Matcher m = p.matcher(mobiles);
return m.matches();
booleanisMobileNO(String phoneNum)
is Mobile NO
final String regx = "^((13[0-9])|(15[^4,\\D])|(18[0-9]))\\d{8}$";
Pattern p = Pattern.compile(regx);
Matcher m = p.matcher(phoneNum);
return m.matches();
booleanisLegalPhoneNumber(String phoneNumber)
is Legal Phone Number
String strPattern = "^((13[0-9])|(14[5,7])|(15[0-9])|(18[0-9]))[0-9]{8}$";
Pattern p = Pattern.compile(strPattern);
Matcher m = p.matcher(phoneNumber);
return m.matches();
booleancheckPhone(String phone)
check Phone
Pattern pattern = Pattern.compile("^13/d{9}||15[8,9]/d{8}$");
Pattern p = Pattern
        .compile("^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$");
Matcher matcher = p.matcher(phone);
if (matcher.matches()) {
    return true;
return false;
...
booleanisPhoneNumber(String phoneNum)
is Phone Number
String expression = "^((13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$";
CharSequence inputStr = phoneNum;
Pattern pattern = Pattern.compile(expression);
Matcher matcher = pattern.matcher(inputStr);
if (matcher.matches()) {
    return true;
return false;
...