We recently had an exchange on the developer portal with an administrator who wanted to:
- Start Enterprise Browser when the device was powered on.
- Prevent end users from accessing any application other than Enterprise Browser.
The customer was using Zebra’s TC8000 device so the solution had to cover both Android KitKat and Android Lollipop (and of course remain correct for more recent versions of Android).
Zebra’s Enterprise Home Screen (EHS) is a perfect tool to accomplish this task and it’s worth highlighting for a wider audience how to achieve this. I did create a post first published last year where I gave an overview of the different ways to lock down your device but here I would like to give a more focused example.
The steps to achieve the goal are as follows:
- Load Enterprise Home Screen on the device and configure it to auto-launch Enterprise Browser
- Load Enterprise Browser on the device and configure the start page to point to your HTML application
- Configure kiosk mode, either through Enterprise Home Screen (for KK in this scenario) or through Enterprise Browser (for L and above)
- Set the default launcher to be Enterprise Home Screen using StageNow.
Load Enterprise Home Screen on the device and configure it to auto-launch Enterprise Browser
Download Enterprise Home Screen. Take care that the version of EHS supports the OS’ you are targeting, for example our Lollipop device will use EHS 2.7_A, the latest available version at the time of writing.
Within the EHS configuration set the auto_launch configuration as follows:
<auto_launch> <application delay="10000" package="com.symbol.enterprisebrowser" activity=""/> </auto_launch>
<preferences> … <auto_launch_enable>1</auto_launch_enable> </preferences>
Push the EHS configuration file to the device:
adb push enterprisehomescreen.xml /enterprise/usr/enterprisehomescreen.xml
Load Enterprise Browser on the device and configure the start page to point to your HTML application
Download Enterprise Browser. Take care that the version of EB supports the OS’ you are targeting, for example our Lollipop device will use EB 1.8, the latest available version at the time of writing.
Within the EB configuration set the StartPage tag as follows (I am using the default here but you would replace with your own HTML file location):
<General> <Name value="Menu"/> <StartPage value="file://%INSTALLDIR%/menu.html" name="Menu"/> </General>
Push the EB configuration file to the device:
adb push Config.xml /storage/sdcard0/Android/data/com.symbol.enterprisebrowser/Config.xml
Configure Kiosk Mode
This post will cover two of the available kiosk modes, there are others but these two are best suited the original question which prompted this post.
1. Using Enterprise Browser “custom kiosk mode”
This technique is only available with Enterprise Browser 1.7 or higher and running on Android Lollipop or higher.
You can enable EB’s kiosk mode by specifying the following in Config.xml:
<CustomKioskMode> <setHomeKeyDisable value ="1"/> <setStatusBarDisable value ="1"/> <setBackKeyDisable value ="1"/> <setVolumeButtonDisable value ="1"/> <setRecentAppDisable value ="1"/> </CustomKioskMode>
2. Using EHS kiosk mode
This technique is most useful for unmanaged devices. If the Enterprise Browser kiosk mode cannot be used in your deployment, either because you are not using EB or you need to run on KK devices then the EHS kiosk mode is recommended.
You can enable EHS’ kiosk mode by specifying the following in enterprisehomescreen.xml:
Enable Kiosk mode:
<preferences> … <kiosk_mode_enabled>1</kiosk_mode_enabled> </preferences>
Specify the application to run during kiosk mode:
<kiosk> <application label="Enterprise Browser" package="com.symbol.enterprisebrowser" activity=""/> </kiosk>
Configure the default launcher
Having installed Enterprise Home Screen, it is necessary to set EHS as the default launcher. You can set the default launcher using the MX AppManager with StageNow and I have attached an example StageNow project to this post which shows how this is done (SetEHS zip & pdf). You will need to know the package name of EHS which is com.symbol.enterprisehomescreen.
Putting it all together
As can be seen in the embedded video, after booting the device, Enterprise Browser will launch and the user will not be able to exit from the application
Returning to normal
After running through this post you can return your device to normal by doing the following. You will find enterprisehomescreen_default.xml within the ‘config files.zip’ file:
- Quit Enterprise Browser either via the ‘Return to OS’ button on the default home page or the application quit method. This will re-enable the home key.
- Scan the Re-Enable_Default_Launcher barcode in StageNow (Re-Enable_Default_Launcher.pdf attached to this post). This will allow the default launcher to run after we uninstall EHS.
- adb push enterprisehomescreen_default.xml /enterprise/usr/enterprisehomescreen.xml. This will re-enable all the system settings.
- adb uninstall com.symbol.enterprisebrowser. This will uninstall EB.
- adb uninstall com.symbol.enterprisehomescreen. This will uninstall EHS.
- adb reboot. This will reboot the device (probably not required but a good idea nonetheless.