I have a hybrid application written on phonegap for android tablets. Now I want the tablet to show only my application. Basically I want the tablet to be always in kiosk mode running only my application. So that all the buttons are disabled. I have looked for solutions online and one of them is to use "surelock", but it doesnt do all of the above. Another option is to write my own ROM, however I couldnt find any good tutorials on that. Can anyone help me plz?
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. Enter the technician password and click on Confirm.
Yes! Nearly any Android device with a touchscreen can be run in kiosk mode.
I did a lot of research and now finally I am satisfied with what I got.
You basically have two options :
Create you own custom ROM, which is not the best solution for me.
Customize the tablets using various hacks.
So I will be explaining the second option.
First you need to root your devices. There are various methods, but I prefer rooting by oneclick software. For Chinese tablets you can use VROOT and for more popular ones use Kingo root.
Now, that you have your device rooted, we can get rid of the top and bottom bar.
private void hideBar(){
try
{
Process proc = Runtime.getRuntime().exec(new String[]{"su","-c","service call activity 42 s16 com.android.systemui"});
proc.waitFor();
}
catch(Exception ex)
{
Toast.makeText(getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
Log.e("ROOT ERROR", ex.getMessage());
}
}
This will make the top and bottom bar disappear. However you will probably need a way to show the bars again. For that you can use:
public void showBars(){
try
{
String command;
command = "LD_LIBRARY_PATH=/vendor/lib:/system/lib am startservice -n com.android.systemui/.SystemUIService";
String[] envp = null;
Process proc = Runtime.getRuntime().exec(new String[] { "su", "-c", command }, envp);
proc.waitFor();
}
catch(Exception ex)
{
Toast.makeText(context.getApplicationContext(), ex.getMessage(), Toast.LENGTH_LONG).show();
}
}
Ok so we have that, all that remains is to make your application start at boot time. For that you can find many tutorials, just google.
With Android L-release (Lollipop) there is a feature called pinning that is pretty much the equivalent of Kiosk mode. Here is a link that explains how to set it up.
I believe Apple introduced this first in iOS. Even though the OP hasn't asked, I am also providing the details for iOS:
Android: http://www.cnet.com/how-to/ho-to-pin-apps-in-android-5-lollipop/
iOS: http://www.webascender.com/Blog/ID/447/How-to-Setup-Kiosk-Mode-Lock-Your-iPad-to-Just-One-App#.VzrO2ZN95E5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With