validate an phone number on Android


public final static boolean isValidPhone(CharSequence target) {
   if (target == null) {
       return false;
   } else {
       return android.util.Patterns.PHONE.matcher(target).matches();
   }
}