-
- All Known Implementing Classes:
AndroidBrowserService,DummyBrowserService,IOSBrowserService
public interface BrowserServiceLaunches the default browser of the platform as a separate application process. The browser will be opened with the provided URL.Example
BrowserService.create().ifPresent(service -> { service.launchExternalBrowser("https://gluonhq.com/"); });Android Configuration: none
iOS Configuration: none
- Since:
- 3.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static java.util.Optional<BrowserService>create()Returns an instance ofBrowserService.voidlaunchExternalBrowser(java.lang.String url)Launches the user-default browser to show a specified URL.
-
-
-
Method Detail
-
create
static java.util.Optional<BrowserService> create()
Returns an instance ofBrowserService.- Returns:
- An instance of
BrowserService.
-
launchExternalBrowser
void launchExternalBrowser(java.lang.String url) throws java.io.IOException, java.net.URISyntaxExceptionLaunches the user-default browser to show a specified URL.- Parameters:
url- The URL to load when the browser application opens.- Throws:
java.io.IOException- If the URL can't be openedjava.net.URISyntaxException- If it is not a valid URL string
-
-