Introduction
Xamarin is a platform to develop cross-platform and multi-platform apps (for example, Windows phone, Android, iOS). In Xamarin platform, the code sharing concept is used. In Xamarin Studio, Visual Studio is also available. E-mail validation is called and an E-mail has a format, which is like [email protected]. Thus, this article describes how to validate an E-mail.
Prerequisites
- Visual Studio 2015 Update 3.
The steps, given below are required to be followed in order to validate an E-mail address in Xamarin Android app, using Visual Studio 2015.
Step 1
Click File--> select New--> select Project. The project needs to be clicked after opening all the types of the projects in Visual Studio or clicking (Ctrl+Shift+N).

Step 2
After opening the New Project, select Installed-->Templates-->Visual C#-->Android-->choose the Blank app (Android).
Now, give your Android app a name (Ex:sample) and give the path of your project. Afterwards, click OK.

Step 3
Now, go to Solution Explorer. In Solution Explorer, get all the files and sources in your project.
Now, select Resource-->Layout-->double click to open main.axml page. To write XAML code, you need to select the source .
Choose the Designer Window if you want to design it and you can design your app.

Step 4
After opening main.axml, file will open the main page designer. You can design the page, as per your desire.

Now, delete Default hello world button. Go to the source panel and you can see the button coding. You need to delete it.
After deleting the XAML code, delete C# button action code.
Go to the MainActivity.cs page. You need to delete the button code.
Step 5
Now, go to the toolbox Window. In the toolbox Window, get all the types of the tools and controls.
You need to go to the toolbox Window. Now, scroll down and you will see all the tools and controls.
You need to drag and drop the Plain Text (EditText).

Step 6
You need to drag and drop the TextView, as shown below.

Step 7
You need to drag and drop the Button, as shown below.

Step 8
Now, go to the properties Window. You need to edit the Plain Text (EditText) Id Value (EX: android:id="@+id/txtemail").

Step 9
You need to edit the TextView Id Value (EX: android:id="@+id/txtdisplay" ).

Step 10
Also, edit the Button's Id value and Text value. (Ex: android:id="@+id/btnvalidate" android:text="Validate")

Step 11
In this step, go to the Main.axml page Source Panel. Note, the EditText's Id value, TextView's Id value and Button's Id Value.
Main.axml









Join the conversation! Your thoughts help the community grow.