Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enabling KioskMode in Android 4.4.2 with Root

I was able to enable kiosk mode in pre-KitKat-releases by killing the com.android.systemui process. Anyhow, this seems not to work in KitKat-releases: After killing the process the whole screen got stuck and I am not able to press any buttons.

After inspecting similar apps from the Play Store I saw recent updates providing a compatibility for KitKat (e.g. Sure lock demo link). Can somebody explain this KitKat-compatibility?

Can somebody name a new way to hide the navigation and status bar in KitKat-releases with root priviledges?

Best regards in advance, Greeny

like image 354
Greeny Avatar asked Jan 26 '14 12:01

Greeny


People also ask

How do I turn on kiosk mode on Android?

To enable kiosk mode on your Android devices, Navigate to the Manage Tab and select the Devices/Device Groups/Users/User Groups for which kiosk mode is to be enabled. Click on Actions and select Enable Kiosk Mode.

Can you run an Android tablet in kiosk mode?

If you're looking to use an Android tablet as a kiosk and lock down the device to a single app, there are a wide range of apps available to download. Check out our guides below on how to set up applications such as GoKiosk, Scalefusion or SureLock to activate kiosk mode on your Android tablet.


1 Answers

May be you can give a try with the below code snippet to show/hide status bar on rooted android devices.I'v tested this on 4.2.2 , 4.4.2 with success.Good luck :)

To hide:

        Process proc = null;

        String ProcID = "79"; //HONEYCOMB AND OLDER

        if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH){
            ProcID = "42"; //ICS AND NEWER
        }

        try {
            proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "service call activity "+ProcID+" s16 com.android.systemui" });
        } catch (Exception e) {
            Log.w("Main","Failed to kill task bar (1).");
            e.printStackTrace();
        }
        try {
            proc.waitFor();
        } catch (Exception e) {
            Log.w("Main","Failed to kill task bar (2).");
            e.printStackTrace();
        }

To show:

        Process proc = null;
        try {
            proc = Runtime.getRuntime().exec(new String[] { "su", "-c", "am startservice -n com.android.systemui/.SystemUIService" });
        } catch (Exception e) {
            Log.w("Main","Failed to kill task bar (1).");
            e.printStackTrace();
        }
        try {
            proc.waitFor();
        } catch (Exception e) {
            Log.w("Main","Failed to kill task bar (2).");
            e.printStackTrace();
        }
like image 132
Basher51 Avatar answered Sep 23 '22 08:09

Basher51