Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { public static boolean isPasswordValid(String password) { Boolean isPasswordValid = true; if (!TextUtils.isEmpty(password)) { if (TextUtils.getTrimmedLength(password) <= 7) { isPasswordValid = false; } } else { isPasswordValid = false; } return isPasswordValid; } }