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.
Prerequisites
The steps, given below are required to be followed in order to view the local Webpage, using WebView 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 projects in Visual Studio
or click (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, 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 the Default hello world button. Go to the source panel and you can see the button coding. You need to delete it.
After deleting 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 WebView.

Step 6
Now, go to the properties Window. You need to edit the WebView's Id value.
(EX:android:id="@+id/LocalWebView" ).

Step 7
In this step, go to the Main.axml page source panel. Note, the VebView's Id value.
Main.axml
- <WebView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/LocalWebView" />

Step 8
In this step, add one New Folder and its name is Content.
Go to Solution Explorer-->Assets-->Right click-->Add-->New Folder and give the name (Ex:content).

Step 9
In this, add two folders inside the Content Folder.(Images, Style).
Go to Solution Explorer-->Assets-->Content-->Right click-->Add-->New Folder. and Give name (Ex:Images,Style).

Step 10
In this step, add the Image from your Local system.
Go to Solution Explorer-->Assets-->Content-->Images-->Right Click-->Add-->Existing Item (Shift+Alt+A).

Step 11
Now, you can choose the required image and click Add.

Step 12
In this step, create HTML file. Its name is Home.Html and write HTML tags, as mentioned below.
Home.HTML
- <html>
- <head>
- <title>Xamarin</title>
- <link href="Style/main.css" rel="stylesheet" type="text/css" /> </head>
- <body>
- <h1>My Main Page</h1> <img src="Images/monkey.png" /><br/>
- <ul>
- <li><a href="second.html">Second Page</a></li>
- </ul>
- </body>
- </html>












Prashant PrakashPosted Sep 21, 2018, 5:35 AM
This article is really usefull, thanks
Madhanmohan DevarajanPosted Nov 17, 2016, 4:07 PM
Thanks for sharing really good information.