Tag Archives: Pattern

Regex validation for removing invalid characters in Android.

This is a simple example in Android to allow only valid characters to enter in a textBox or EditText. I am using this regex pattern to allow only valid characters. “^[a-z_A-Z0-9 ]*$”; This expression allows only characters from a-z, A-Z and numbers from 0-9 and a ‘ ‘(space) character. Here is the java code Main.xml Strings.xml

Email validation in ANDROID.

This is a simple example showing email validation in ANDROID. This example uses regex for email validation. Create a button and an edittext in your main.xml file and try this code. Check this link to find how you can send email from android programatically. Please leave your valuable comments……