Open Browser (Xamarin.Essentials API of the Week)

Play Open Browser (Xamarin.Essentials API of the Week)
Sign in to queue

Description

Xamarin.Essentials provides developers with cross-platform APIs for their mobile applications. On this week's Xamarin.Essential API of the week we take a look at Open Browser, which enables you to open the system optimized browser to any web address with a single line of code!

Show Notes:

Useful Links:

Embed

Download

The Discussion

  • User profile image
    Julian

    Hi James,

    Nice video.

    I have just a question:

    I was previously using a WebView to launch a website. Now i want to implement the Browser API.

    I am trying to call the Browser like:

    await Browser.OpenAsync("https://translate.google.com/#view=home&op=translate&sl=de&tl=es&text=über");

    Saddly, and even though the WebView opens the website with the translation i am looking for, Browser launches the home page, as if it could not manage the exact request.

    Am i doing anything wrong, or is there a limitation i am not aware of?

    Thanks

  • User profile image
    WolfgangH
    Thank, Essantials are great, hope the evolve even more.

    regards
    Wolfgang
  • User profile image
    ttirrell
    Why not just use Device.OpenUri(new Uri(@"http://xamarin.com"))? It seems similar to BrowserLaunchMode.External.

    Obviously BrowserLaunchMode.SystemPreferred is a nice touch.

    Thanks,
    Trevor
  • User profile image
    James​Montemagno
    @ttirrell, the reason you would use this is because it works in any app not just Xamarin.Forms and also the SystemPreferred is a huge advantage compared to the External browser in performance and user experience. We also just added ways to have more control over colors and title :)

Add Your 2 Cents