Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permanently hide Android Bottom Navigation/Statusbar? #552

Open
fabioselau077 opened this issue Feb 24, 2024 · 1 comment
Open

Permanently hide Android Bottom Navigation/Statusbar? #552

fabioselau077 opened this issue Feb 24, 2024 · 1 comment

Comments

@fabioselau077
Copy link

Hello, my app will live on an Android tablet for the public, so logically I need to restrict what will be accessed. I need my app to always stay open, I can't exit it and when the device starts, it starts automatically (optional).

I'm using kiosk_mode, but the app is just pinned, if the person clicks on the screen the Android buttons are shown, in which they can hold and unpin the app, as well as pull the statusbar down and turn off the Wi-Fi, access the settings, for example.

Is there any way to do this blocking? In the application I hid a hidden button in which after entering a password, there are some settings, such as battery percentage, wifi settings, button to exit kiosk mode, which when clicked calls the stopKioskMode() function, to be able to exit the application in case of update, configuration...

But the problem is that the normal user can exit the application and use the tablet normally

Any idea? Thanks!

@Deepak-GP
Copy link

Deepak-GP commented Apr 15, 2024

@fabioselau077
You cannot implement a full scale kiosk mode application in android unless your app has certain privileges - Device Admin app.
Either your device needs be rooted to get the device admin privilege or you need to implement the DPC application to get the device admin privilege.

Some of the links that explains about device admin and lock task mode are as below:
https://developer.android.com/work/device-admin
https://developer.android.com/work/dpc/dedicated-devices/lock-task-mode

And to build your own DPC app you can go through this repo:
https://github.com/googlesamples/android-testdpc

There is an app as well which shows how a device policy controller app works in real time.
https://play.google.com/store/apps/details?id=com.afwsamples.testdpc

If your devices are rooted, then DPC app is not required. You can directly assign the device admin privilege to your app using su command - dpm set-device-owner yourPackageName
And then add the your package to the lock task package list using setLockTaskPackages. (This step is not required when you are using the kiosk_mode flutter package)
This will make sure that the home button and app switcher button is hidden in the system UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants