GTU DE Sem6 – 3360704 – 3 – Create login application where you will have to validate EmailID (UserName). Till the username and password is not validated , login button should remain disabled.

GTU DE Sem6 – 3360704 – 3 – Create login application where you will have to validate EmailID (UserName). Till the username and password is not validated , login button should remain disabled.

DE Sem6 - 3360704 - 3 - Create login application where you will have to validate EmailID

 

In this Android Application I am going to explain how we can validate email address using regular expression. Basically when user enters email address it should be in proper form, Sometimes user make mistakes while entering email address, so we can implement following code to check weather user has enter a correct email address or not. This can be done using Pattern class from java.util.regex.Matcher. and you need to use matches(). Matches() will return either true or false you can take some actions on this. Before you use matches() you need to use Pattern.Compile using exact regular expression of Email Address.

 

FileName: MainActivity.java

 

 FileName: activity_main.xml

 

Output : Initial : Disabled Login Button

DE Sem6 - 3360704 - 3 - Create login application where you will have to validate EmailID

Output After You Enter proper Email Address

DE Sem6 - 3360704 - 3 - Create login application where you will have to validate EmailID

Adarsh Patel

My Self Adarsh Suryakant Patel. Currently I am working as Assistant Professor at Parul Instiute of Engineering and Technology, MCA Department, Limda, Vadodara. Major Responsibility : * Lectures * Organizing Training and Expert Sessions for * Placement and Recruitment * Faculty Representative