Skip to content Skip to sidebar Skip to footer

Keep The Same Application Always

I not sure if this can be done. I want to develop a website and keep it in the device always, without the possibility of exit. I mean disabling the hardware/software buttons and o

Solution 1:

Sounds like you want to implement something like a Kioskmode. The Kioskmode is only available on Samsung devices. On other devices you have to implement a Kiosk by yourself. But it is possible! There are some nice tutorials in the web. However you need to implement an application to get the user interactions.

First of all you need to activate the Kiosk after booting the device. You can use a Broadcast Reciever to get the Boot Event:

<receiverandroid:name=".BootReceiver"><intent-filter ><actionandroid:name="android.intent.action.BOOT_COMPLETED"/></intent-filter></receiver>

You have to declare the permission in your manifest file:

<uses-permissionandroid:name="android.permission.RECEIVE_BOOT_COMPLETED" />

You can start your implementation in a class witch extends the BroadcastReciever. Start the activity from the actual android context.

publicclassBootReceiverextendsBroadcastReceiver
 {

  @OverridepublicvoidonReceive(Context context, Intent intent)
   {
    IntentkioskIntent=newIntent(context, KioskMode.class);
    kioskIntent .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
    context.startActivity(kioskIntent);
   }
 }

In the activity you can disable every button of the device, like back pressed, etc. You can find a good tutorial for developing a kiosk under the following link, it shows how to disable power button, home button, back pressed,etc.:

http://www.andreas-schrade.de/2015/02/16/android-tutorial-how-to-create-a-kiosk-mode-in-android/

To disable the statusbar you just need to hide it with a theme:

android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"

To display a HTML Page you can use a WebView. However in a webview is javascript and all errors disabled. So if you just want to show some information on the page your good with a WebView.

http://developer.android.com/reference/android/webkit/WebView.html

Solution 2:

It is possible to use android for this type of scenario but only in Android 6.+

See Single use devices here for some information

I hope this is the information you are looking for.

Post a Comment for "Keep The Same Application Always"