how do i start any simple app in kiosk mode?

10,472

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.

Surelock

Share:
10,472
Varun Barve
Author by

Varun Barve

Updated on June 16, 2022

Comments

  • Varun Barve
    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
    Varun Barve over 10 years
    Thanks 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
    Eluvatar over 10 years
    you 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
    Boardy over 10 years
    As @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
    Varun Barve over 10 years
    the 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
    Boardy over 10 years
    I 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
    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