The Browser class is available at Xamarin.Essentials API. It is used to enable an application to open the web link in the default browser. Android, iOS, and UWP offer unique operating system and platform APIs that developers have access to all in C# leveraging Xamarin. Xamarin.Essentials provides a single cross-platform API that works with any Xamarin.Forms, Android, iOS, or UWP application that can be accessed from shared code no matter how the user interface is created.
Reading this article, you can learn how to open a web link with default Browser in Xamarin Forms application using Xamarin Essentials for Android and Universal Windows Platform with XAML and Visual C# in cross-platform application development.
The following important tools are required for developing Xamarin Forms App,
- Windows 10 (Recommended)
- Visual Studio 2017
- Android API 19 or higher and UWP 10.0.16299.0 or higher
Now, we can discuss step-by-step app development.
Step 1
Open Visual Studio 2017 -> Start -> New Project-> Select Cross-Platform (under Visual C#-> Mobile App (Xamarin.Forms)-> Give the Suitable Name for your App (XamFormBrowser) ->OK.
Step 2
Select the Cross-Platform template as a Blank APP ->Set Platform as Android and UWP and code sharing strategy as .NET standard, Afterwards, Visual Studio creates 3 projects (Portable, Android, UWP).
Step 3
For adding a reference,
Right-Click Your solution (XamFormBrowser) and Select Manage NuGet Packages.
For adding Xamarin.Essentials Reference, Choose Browse and Search Xamarin.Essentials, select the package and select all the projects (portable, Android, UWP) and install it.
Step 4
Add the Label, Entry and Button controls in Mainpage.Xaml for displaying Title and weblink and browse button.
- <Label FontAttributes="Bold" Text=" Open a web link using default Browser in Xamarin Forms application using Xamarin Essentials for Android and UWP" VerticalOptions="Center" HorizontalOptions="Center"/>
- <Entry x:Name="entURL" Placeholder="Enter the URL to open here"></Entry>
- <Button x:Name="btnBrowse" Text="Click to Browse" Clicked="btnBrowse_Click"/>


Rajesh KumarPosted Mar 15, 2022, 8:51 AM
Nice sir very helpful video
nagesh vechaPosted Feb 12, 2020, 8:11 AM
Hi Vijayaragavan S How can i pass the text app to opening browser any idea how to do?
Rushi MehtaPosted Nov 13, 2018, 12:10 AM
Very nicely explained the article