Patterns and Regular Expressions
In Java usually validate with some specific characters, we should use Regular Expressions. Same way in Android, here we use Patterns. More info about the Patterns: Click here In android EditText, we can use custom input filter to perform this. This is for maximum input digits before and after decimal pointer. CustomInputFilter.Java public class CustomInputFilter implements InputFilter { int maxDigitsBeforeDecimalPoint; int maxDigitsAfterDecimalPoint; public CustomInputFilter(int maxDigitsBeforeDecimalPoint, int maxDigitsAfterDecimalPoint) { this.maxDigitsBeforeDecimalPoint = maxDigitsBeforeDecimalPoint; this.maxDigitsAfterDecimalPoint = maxDigitsAfterDecimalPoint; } @Override public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) { StringBuilder builder =...