Here Are Some Function for validation
if value has any special character in that function return value "true" otherwise "false"
public booleanHasSpecialCharacter(String value)
{
for (int i = 0; i < value.length(); i++) {
if (!Character.isLetterOrDigit(value.charAt(i)))
return true;
}
return false;
}
==============================================
if value has NULL function return value "true" otherwise "false"
public boolean IsNull(Object value) {
if (value != null)
return true;
return false;
}
Note:- You can pass any object in this function (eg. TextView,EditText,....)
===================================================
if value has no data & null value in that function return value "true" otherwise "false"
public static boolean IsEmpty(String value)
{
if (IsNull(value)) {
return true;
} else {
if (value.trim().length() <= 0) {
return true;
}
}
return false;
}