FULL KIOSK MODE

122 views
Skip to first unread message

Rainer Trunk

unread,
Aug 25, 2018, 5:45:50 PM8/25/18
to DroidScript
Hello,

I have read here in the Forum that the Build in Kiosk Mode of DS not always Work.
It depends on the Android Version you are running.
Now I find a way to get a Full KIOSK Mode where we disable Navigation and Status Bar complete!
All you need is Root Access on the Box to make it happen.

Here is my Code:

//Called when application is started.
function OnStart()
{
//Create a layout with objects vertically centered.
lay = app.CreateLayout( "linear", "VCenter,FillXY" );

//Create a text label and add it to layout.
txt = app.CreateText( "FULL KIOSK" );
txt.SetTextSize( 20 );
lay.AddChild( txt );
//Add layout to app.
app.AddLayout( lay );
btn = app.CreateButton( "Enable Full KIOSK Mode ",0.3,0.1 );
    btn.SetOnTouch( enable );
    lay.AddChild( btn );
    btn1 = app.CreateButton( "Reverse it!!",0.3,0.1 );
    btn1.SetOnTouch( disable );
    lay.AddChild( btn1 );
}

function disable()
{
  sys = app.CreateSysProc("su");
  sys.Out("am startservice -n com.android.systemui/.SystemUIService\n ");
}

function enable()
{
    sys = app.CreateSysProc("su");
    sys.Out("service call activity 42 s16 com.android.systemui\n ");
}

All that is does is Stopping the SystemUI Service Until you re-enable it.
Hope it is useful for somebody.

Regards
Ray

Dave

unread,
Aug 26, 2018, 8:57:13 AM8/26/18
to DroidScript
Thanks Ray, that could be useful :)

I've managed to get the DS kiosk mode working again for >= Android 7.0 by asking for user permission to write over other apps.  This will be in the next beta release along with the facility to create custom overlays (including 'chat heads')
Reply all
Reply to author
Forward
0 new messages