Completely hide android StatusBar and ActionBar

Hello everybody,

been fiddling around with Ionic Framework for some time now and absolutely love it!

I came across a problem with the app I am currently making. I am deploying my application on an Archos tablet running Android 5.1.1. Since I want my application to be the only application the user can access on this device, I am trying to hide the StatusBar and ActionBar. I can hide these bars using one or more of the following commands, however they are not persistent.

StatusBar.hide(); $cordovaStatusbar.hide()

These commands hide the StatusBar and ActionBar, when I swipe down (or up) on the top (or bottom) of my tablet, they reappear again. Since what I am looking for is similar to “Kiosk mode”, I also tried the following plugin https://github.com/honza889/cordova-plugin-kiosk , but again I can swipe to make the Action and StatusBar reappear. It seems this is hardcoded in the tablet I am using. There was another question about a similar topic on this forum Kiosk mode?, but the answer over there didn’t seem useful to me. (I tried, but could not get it to work).

Does anybody know a way to prevent the user from requesting the statusBar or actionBar, so that I can create a good Kiosk mode for my ionic app?

Thank you for your help

I tried to implement the following plugin (https://github.com/oddmouse/cordova-plugin-locktask), and I am able to set my app to the “pinning mode”.

However, I have trouble implementing the third step of the plugin readme:

Add a device admin sub class of DeviceAdminReceiver.

package com.exapmle.package;
import android.app.admin.DeviceAdminReceiver;
public class DeviceAdminExample extends DeviceAdminReceiver {
// Some code here if you want but not necessary
}

Does anybody know where I have to add that subclass? I browsed through my cordova android files but could not find anything.