Building a Browser for Dedicated Devices

Building a Browser for Dedicated Devices

1st May 2019 0 By darryncampbell

It is no secret that Android provides a highly customizable WebView control to render HTML with a native application and many apps do this to a greater or lesser degree to display web content within their apps.

It is not too much of a leap to ask ‘can I build my own browser’ using theWebView control and unsurprisingly, yes, you can but the bigger question is why anybody would want to – with Chrome, Edge, Opera and Chromium we have enough browsers based on the Chromium rendering engine that we do not want another fully-featured browser.

There is a niche here though for dedicated devices running Android where developers / administrators will frequently want to show a web page to the end user without allowing that user to navigate away from the page (think of a public kiosk, information display or handheld mobile computer). Particularly in the case of mobile computers that web page could be an entire web-based application and though you could obviously use Cordova or some similar technology to wrap your web page into a native app this is often seen as an unnecessary hassle.

So, what browsers are there for dedicated devices? I don’t see a lot in the Play Store – there are a lot of browsers (literally pages) but if you narrow that search to look for ‘kiosk browser’, ‘lockdown browser’ or ‘fullscreen browser’ you don’t get any promising results. Either the browsers also want to be Device Administrators (so won’t be compatible with EMMs once Android shifts entirely to the Device Owner model) or they are still user focused offering features like tabs and user settings.

The requirements for a browser designed for a dedicated device are (in my opinion):

  • No user-facing controls or configuration. All the user is able to do is to interact with the web page
  • Configurable by an administrator via Managed Configurations (through the EMM)
  • Configurable via a config file for deployments which lack an EMM or for testing purposes
  • Ability to work nicely with other Android tools designed to lock down the OS and e.g. prevent the user from returning to the home screen or pulling down the notification shade. In particular the browser should not have to be a Device Administrator or Device Owner.
  • Highly customizable, e.g. returning to a specific page in the event of a navigation timeout or the ability to ignore SSL errors for testing purposes.

I have put together the bare-bones of a ‘Dedicated Device Browser’ in GitHub. The code in its present form is functional but would probably need to support additional configuration before it would be useful in an enterprise setting.

Functionality supported by my Dedicated Device Browser:

  • Specify a start page via either managed configurations or through a configuration file
  • Request to enter lock task mode (where whitelisted by the DO)
  • Ignore SSL errors
  • Ignore file-based configuration and only use managed configs (in case of security concerns with file-based configs)
  • Log an error to logcat when a page load fails

Ways in which the Dedicated Device Browser could be enhanced

  • Support of additional configuration options. There are many of these including safe browsing, page zoom, handling key events and overriding URLs (so only certain URLs can be loaded). See WebView and WebViewClient.
  • Proper error handling when pages fail to load (could navigate to a ‘safe’ page)
  • Being in the public Play Store would enable the application to be easily deployed through any “Managed Play Store”.
  • Interaction with native APIs through JavaScript e.g. listening for Android Intents to pass through to the web page or controlling specialised hardware on the device like a barcode scanner.

Hopefully this has given an introduction into what a browser designed for enterprise Android devices should do and how an enterprise might go about creating their own dedicated browser which meets their needs. For more information on the sample Dedicated Device Browser then please see that application’s readme which includes screenshots and videos. rendered in the ‘dedicated device browser’