Java tutorial
//package com.java2s; import android.text.TextUtils; public class Main { private static final int USER_PASSWORD_LEN_MIN = 8; private static final int USER_PASSWORD_LEN_MAX = 16; public static boolean checkUserPassword(String password) { if (TextUtils.isEmpty(password) || password.length() < USER_PASSWORD_LEN_MIN || password.length() > USER_PASSWORD_LEN_MAX) { return false; } return true; } }