Skip to content

How to open web link in default browser Android in a cross-platform project? #16983

Answered by GersonTommas
GersonTommas asked this question in Q&A
Discussion options

You must be logged in to vote

This was solved:

  • Create an Interface (IOpenWebPage) in the main project
  • Create classes on each project that implement that interface (AndroidOpenWebPage : IOpenWebPage --- DesktopOpenWebPage : IOpenWebPage)
  • Set a static object in the shared project like public static IOpenWebPage openWebPage;(or however you called your Interface in step 1)
  • In each project initialization process add Shared.openWebPage = new AndroidOpenWebPage() or Shared.openWebPage = new DesktopWebPage() use the one that corresponds to the platform. (Shared is the name of my class in the shared project, replace with whatever your class is called)

If anyone thinks an example would be useful I'll add one.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@thevortexcloud
Comment options

@zipgenius
Comment options

@rabbitism
Comment options

@zipgenius
Comment options

Answer selected by GersonTommas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants