I'm trying to hide the system Status Bar on an Android 4.4 device. This is for a kiosk-mode where my app will be the only app ever run on the device. The target device for now is a 2013 Nexus 7.
The device is rooted, and I've been able to completely remove the bottom Navigation Bar with some info from this post.
For the top Status Bar, everything I have tried only hides the bar temporarily. If my users motion down at the top of the screen, the status bar reappears. I don't want to allow them to see the time, get to settings or even see notifications.
Posts I've found and already tried:
- Hide System Bar in Tablets
- Permanently hide navigation bar on activity
- Hide status bar on android
- Disable/Hide status bar in Android
Any suggestions?
Ideally, I'd love to be able to edit build.prop to do this, since I'm already doing that for the navigation bar, and could do this at the same time. I'm trying to not have to build my own android image.
Update:
After some more work, this seems to depend somewhat on the exact build of android, or the device its running on.
Some devices, such as the Nexus series I've been working with allow the user to swipe to make the bar reappear.
However, I've recently tried this on a Verizon Eclipse, and the bar does not reappear, which is what I was looking for.
I'm still looking for a better solution to target all devices, but it will probably come down to creating my own build of android.
I did try the workaround provided by @gonglong, but I wasn't happy with the result because of a flash in the UI as the workaround kicked in.
Instead, I was able to do this as root:
I think on a normal device, this would cause the initial device setup to start, but on my devices, I've removed that APK from system so that doesn't happen.
This isn't documented anywhere I can find, but has a nice effect, where the top settings UI can't be dragged down. The notifications area can still be dragged down.
Another setting that I found useful was:
This hides the Airplane Mode and Silent Mode options from the Power menu, which is an added bonus for my application.
There might be more side effects, but I've yet to find any that matter to me.
Full List
This list was taken from a Nexus 7 2013 LTE running brand new Android 4.4.3 (KTU84L). The number in square brackets is the value when I pulled the db file, which was after basic setup device setup and enabling developer/USB, but before making any other changes in settings
This file was found at
data/data/com.android.providers.settings/databases/settings.db
Note: Some URLS required adding an extra space character to bypass SO filters
system
namespaceglobal
namespacesecure
namespaceI've used this answer to hide the softkeys: https://stackoverflow.com/a/27003890/1525867
And for disabling the StatusBar (this may harm your device so do it carfully. I've ruined my device several times before I managed to do it) Tested on Asus Tinker Board, Android 6:
path
in your favorite waypull
SystemUI.apk
from your device:adb pull /system/priv-app/SystemUI/SystemUI.apk
the path toSystemUI.apk
may be differentpull
framework-res.apk
from your deviceadb pull /system/framework/framework-res.apk
the path toframework-res.apk
may be differentrun
apktool if framework-res.apk
run
apktool if SystemUI.apk
run
apktool d SystemUI.apk
Open
SystemUI\res\layout\status_bar.xml
and addandroid:visibility="gone"
to the top most xml element (for me it wascom.android.systemui.statusbar.phone.PhoneStatusBarView
)run
apktool b SystemUI
Go to
SystemUI\original
and copyAndroidManifest.xml
andMETA-INF
toSystemUI\build\apk\
run
apktool b SystemUI
againGo to
SystemUI\dist\
and override the device's originalSystemUI.apk
with the one atSystemUI\dist\SystemUI.apk
withadb push SystemUI\dist\SystemUI.apk /system/priv-app/SystemUI/SystemUI.apk
Restart device
Based on this thread https://forum.xda-developers.com/showthread.php?t=2203166
I know this is an old question but hopefully it will help someone. Here are two very simple calls to disable and enable the status bar that I have used before. Can be used from the command line or executed by a Java app:
Disable:
Enable:
A great solution I found for that issue, setting each Activity
theme
&windowSoftInputMode
to the following values :for more info refer here.
add this before : setContentView(R.layout.x);
I don't have a perfect solution but a workaround here. The basic idea is to listen the system ui status changes and force navigation/status bar as invisible. It takes effect as similar as setting IMMERSIVE_STICKY mode but disappearing navigation/status bar quicker than IMMERSIVE_STICKY.
here it is:
set system ui style in onCreate() and on onResume function, and set system ui change listener
force system bar as invisible in onSystemUiVisibilityChange, setting system ui some seconds later otherwise it would take on effect(does not know exactly why, maybe system just ignores the system ui setting request when system bar showing not yet completed)
then you can set system ui like this: