Menu

Kiosk Mode

Kiosk mode allows enterprises to restrict user access to selected apps and features on the device. You can make these apps and features available through the Kiosk home screen.

About Kiosk mode

Through the Knox SDK, you can enable, disable, and define device behavior for the Kiosk mode. These APIs can also be used in conjunction with other APIs, and you can use Kiosk mode APIs without enabling Kiosk mode.

For more powerful control over all a device's settings, see ProKiosk.

Create a Kiosk

In this example, we will enable Kiosk mode with the following:

  • Four apps allowed when the Kiosk mode starts
  • Notification bar is invisible
  • Enterprise wallpaper in the background

To do this:

  1. Get Kiosk mode object and app policy object.
  2. Apply the Kiosk settings and enable Kiosk mode.
  3. Add packages to the Kiosk and set the wallpaper.
EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
KioskMode kioskModeService = edm.getKioskMode();
ApplicationPolicy appPolicy = edm.getApplicationPolicy();

KioskSetting kioskSetting = new KioskSetting();
kioskSetting.StatusBar = false;
km.enableKioskMode(kioskSetting);

String pkgs[] = new String[] { "com.android.email", "com.android.calendar", "com.sec.android.app.camera", "com.google.android.youtube"};
String kioskHomePackage = km.getKioskHomePackage();
for ( int i = 0; i < 4; i++ ) {
        appPolicy.addHomeShortcut(pkgs[i], kioskHomePackage);
        }

WallpaperManager wpm = WallpaperManager.getInstance(Context); /*Use reference of Context*/

Bitmap backgroundImg = BitmapFactory.decodeFile("/sdcard/backgroundImg.bmp");
wpm.setBitmap(backgroundImg);

Check for successful Kiosk creation

If you want to be notified when your Kiosk mode is created, you can listen for the the broadcast intent - ACTION_ENABLE_KIOSK_MODE_RESULT.

You need an intent filter and additional elements for the Broadcast receiver.

  1. Check for successful Kiosk creation
  2. Add a broadcast receiver.
IntentFilter kioskIntent = new IntentFilter(KioskMode.ACTION_ENABLE_KIOSK_MODE_RESULT);
TestBroadcaster kioskBroadcast = new TestBroadcaster();
registerReceiver(kioskBroadcast, kioskIntent);
//Add Kiosk mode to a broadcast receiver.
public class TestBroadcaster extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals(KioskMode.ACTION_ENABLE_KIOSK_MODE_RESULT)) {
            displayMessage(context, "Kiosk Mode enabled successfully");
        }
    }
}

More device setting examples

While in kiosk mode, you might want to disable certain device features that might interfere with operation of the allowed apps. Example features are:

SmartClip is a way to use a stylus pen to outline and crop images displayed on the device screen, to share or paste with other apps. While in Kiosk mode, you can block this feature using the API method allowSmartClipMode(false):

EnterpriseDeviceManager edm = EnterpriseDeviceManager.getInstance(context);
        RestrictionPolicy restrictionPolicy = edm.getRestrictionPolicy();
        try {
        restrictionPolicy.allowSmartClipMode(false);
        } catch (RemoteException e) {
        Log.e(TAG, "Remote exception : " + e);
        }

AirCommand is a pop-up menu that contains some useful features that a user can use with SPen. The AirCommand menu displays once a user removes SPen from its slot, or by pressing the SPen button. While in Kiosk mode, you can block this feature using the API method allowAirCommandMode(false).

KioskMode kioskModeService = KioskMode.getInstance(context);
try {
    // Administrator wishes to block air command functionality.
    kioskModeService.allowAirCommandMode(false);
} catch (RemoteException e) {
    Log.e(TAG, "Remote exception : " + e);
}

For details about all the other device settings that you can control in Kiosk mode, browse the Knox SDK API reference for the package ccom.samsung.android.knox.kiosk.

Share it: