Java tutorial
//package com.java2s; //License from project: Apache License import android.text.TextUtils; public class Main { public static boolean isPhoneNumberAvailable(String phoneNumber) { if (TextUtils.isEmpty(phoneNumber)) { return false; } if (phoneNumber.length() != 11 || !phoneNumber.substring(0, 1).equals("1") || phoneNumber.contains("*") || phoneNumber.contains("#")) { return false; } else { return true; } } }