how do i start any simple app in kiosk mode?
Solution 1
The simplest method is to make your app a launcher. Therefore as soon as the device loads or the users presses the home button your app will be shown.
You would need to add the following to your Android Manifest for your main activity that you want to be shown at startup/home key press
<activity android:name=".MainActivity"
...
android:launchMode="singleInstance"
android:stateNotNeeded="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.HOME"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Hope this helps
Solution 2
Make your own app a kiosk is complicated to make it work correctly in all android versions.
I've been using solutions like Surelock in a couple of apps that run on preconfigured devices.
Varun Barve
Updated on June 16, 2022Comments
-
Varun Barve almost 2 years
i just wanna start any simple app in a kiosk mode, that is whenever i reboot i want only the app to be started nothing else. So researching a bit i found home replacement app, and disabling the home, menu search and back button. i tried some links about home replacement, but couldnt succeed. so please help if anyone can. thanks I tried changing the intent filter with this..ando
-
Varun Barve over 10 yearsThanks a lot. it helped .. can u please give any link or code for disabling the home, search, menu and back button ?! thanks again for the help !!
-
Eluvatar over 10 yearsyou cant disable the home or menu button, search will only do something if you want it to and you can easily search for back handling in android yourself.
-
Boardy over 10 yearsAs @Eluvatar said you can't disable the home and menu button but why would you want to, the user won't be able to get out of your app if it is a launcher, same with the back button it can't leave your app as it is a launcher
-
Varun Barve over 10 yearsthe thing is its a form kinda thing and if i press back or home button accidently wouldn't it restart the app and reset the form ??!
-
Boardy over 10 yearsI don't believe it would, the home button and back button will only do something if the user was taken to a different activity within your app, although you can't block the home button, you can control the back button, stackoverflow.com/questions/6489059/… might help, you could the answer in this question but not actually do anything,although I don't believe this would be required
-
Basher51 about 10 years@VarunBarve : Check my answer in this link to disable the status bar on a rooted android tablet : stackoverflow.com/questions/11958034/hide-tablet-system-bar