I need to get rid of the system bar on Android 4.1 tablets since the tablets will be in a commercial/retail environment and be used for business. My app will be the only app used on the tablet and it needs as much screen real estate as possible for what we're trying to do. I have searched already and I see that there are ways to do it on a rooted tablet, however since this will be in a business and deployed to several hundred or thousand businesses, I cannot have all the tablets rooted for legal and security issues. (Would I really have issues legally though if I were to root them?)
I know that you can dim the status bar and make the buttons dots but that really isn't optimal.
If there is no way to get rid of it, is it possible to change the status bar icons and functionality? I ask this because our app has a status bar on top and we could possibly move it to the bottom and change the icons and functionality of the status bar to match the app's status bar so no screen real estate is lost.
I have read that 4.2 adds some fullscreen functionality for apps. Is this true? Can the status bar be hidden in 4.2 as opposed to 4.1?
I need to get rid of the system bar on Android 4.1 tablets
That is not possible, except via rooted devices and/or ROM mods. Moreover, the user needs this bar to be there, otherwise they have no access to the HOME and BACK buttons.
Would I really have issues legally though if I were to root them?
StackOverflow is not a law office. Please consult with qualified legal counsel regarding such concerns.
is it possible to change the status bar icons and functionality?
That is not possible, except via rooted devices and/or ROM mods.
I have read that 4.2 adds some fullscreen functionality for apps. Is this true?
Not exactly. The bottom navigation bar (HOME, BACK, RECENTS) can be hidden, but they will return as soon as the user touches the screen. The top status bar (signal strength, battery level, etc.) can be removed via a Fullscreen theme.
Related
Before you flag this as duplicate, I researched this question a long time ago and found this and this, which both suggest that the right side of the notification bar is a system apps ONLY zone.
However, I recently used Betternet and after connecting to the VPN, these two icons appear:
Betternet is not a system app, and my HTC On3 M8 is not rooted. How did they do it?
The left icon is a Notification. These can be displayed by any app.
The right icon is a standard icon, added there by Android, indicating an active VPN connection. These are not put there by apps directly, though certain things that apps implement (e.g., VpnService) might result in an icon being shown there.
My company makes industrial manufacturing products and we ship Android tablets with an app to control a manufacturing process. Ideally this should be the only app the user sees, and we've been able to do this on handheld devices running Gingerbread but on Honeycomb and Ice Cream Sandwich the system bar prevents this.
My understanding is that on Jelly Bean there is more programmatic control over the appearance of the System Bar but I'm unclear on the details. I read http://developer.android.com/about/versions/android-4.1.html but it still wasn't clear to me whether there was any way to actually hide the system bar under programmatic control.
We're too small a company to make our own ROM (I'm the only Android developer) so we're trying to work with the stock version of the OS.
Thanks in advance.
it still wasn't clear to me whether there was any way to actually hide the system bar under programmatic control
Not permanently. The JB options to remove the system bar on a tablet only do so temporarily -- any user input will cause the bar to reappear. Hence, it is unsuitable for your scenario.
We're too small a company to make our own ROM
If you don't mind my asking, did you hunt for a consultant or firm to do this and not find anyone (or anyone suitable)? Or did you not pursue that angle? A custom ROM, or at least a root-change-unroot process, would be the right solution for your problem. I can certainly see where hiring a full-time ROM slinger might be overkill, but one hopes that there are ways of outsourcing that work.
A little background first. I'm developing an application for corporate devices running on the Android platform. It won't be distributed on the Play store and thus, is unavailable to the general public. The devices are owned by the company and its only purpose is to run this application. So accessing the home screen/notifications/application history/ app drawer are unnecessary and in fact we want to focus the user experience directly on this application.
The current problem I'm facing is preventing access to the notification tray. Simply making the application full screen is not a solution. We do actually need to see the status bar. It's the easiest way to provide network,gps and battery status information to the user.
So far my research has only turned up one solution, which is to go full screen (again, not a solution for this problem,I need the status bar to be visible). I know there's a number of lock screen apps that are able to do this so there must be a way. I just haven't found it yet.
I am not sure, but probably that you can't just lock notification bar from the application level. Android app is isolated from the Operating System and another apps, so it is not able to lock OS features.
Solution that came into my head is to make app fullscreen and create Your own status bar with battery level, current time and network status. It is not hard.
Another solution would be to prepare Your own Android distribution :)
Moreover probably You would like to override all buttons (home, back, search) so user is not able to leave your app.
Very likely is not going to be possible on a Stock device, you'd have to root and potentially install your own version of the OS to allow for this behavior. The system was purposefully made to disallow applications from having this type of behavior. The creators of the OS had the general public in mind as users, and they wanted to prevent applications from being able to "lock" the user out of portions of the device.
Much easier solution like #Jacek states is go full screen and make your own View to display whatever info that you do want from the Notifications bar, AFAIK there are public APIs to access all of that information.
I will give my ICS tablets for users to complete a survey so I would like the user to work with my app only. They should not be able to switch to the home screen, press back buttons etc., so I would like to hide the system bar completely.
My tablet is rooted and I know some application like
this can help me, but I don't need all the extra functions of this app.
I found this tutorial that could help me, but if I can add the code to do my own, it would be great.
After a lot of searching on the internet, I managed to get the System Bar to hide and appear in a 4.2 device using:
To Hide:
Runtime.getRuntime().exec("service call activity 42 s16 com.android.systemui");
Or use 79 instead of 42 for API less than 14. You may also need to include the SET_DEBUG_APP permission, in which case you need to have the application signed with the system key or installed in the /system/app/ directory.
To Show:
Runtime.getRuntime().exec("am startservice --user 0 -n com.android.systemui/.SystemUIService");
Alternatively some people have used the -a (instead of -n) option, though this was causing an error on my device:
Error: Not found; no service started.
For Android 4.4, there is a new feature called immersive mode which hides both the system and status bars. The system UI is toggled by the user through the use of an edge swipe from the top or bottom of the screen. For more details take a look at:
http://developer.android.com/reference/android/view/View.html#setSystemUiVisibility(int)
Using new IMMERSIVE mode in android kitkat
For example:
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE)
HideBar has a kiosk mode especially for this use case.
A free download is available at http://ppareit.github.com/HideBar/.
You can also find it in the market at https://play.google.com/store/apps/details?id=be.ppareit.hidebar.
If you want to incorporate it in your own test/survey application you can always contact the developer (see the links for an email). The code could be explained or an Intent to do the hiding could be provided.
check this link: (requires root)
http://android.serverbox.ch/?p=306
similar question was posted here also:
Is there a way to hide the system bar in Android 3.0? It's an internal device and I'm managing navigation
or try HideBar
http://ppareit.github.com/HideBar/
Actually you can simply put the system bar in "lights out" mode, the system bar buttons and notifications gets dimmed.
View v = findViewById(R.id.view_id);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
I want to add some information to the existing replies hoping it will be useful for someone.
To get a real full screen working on my low cost China tablets I need to edit a file located in
system/build.prop
replace the text
ro.property.tabletUI=true
with
#ro.property.tabletUI=true
(I comment the line). After that, I can get a full screen using
android:theme="#android:style/Theme.Black.NoTitleBar.Fullscreen"
for each activity in the minfest.xml
This solution Is good only if you sell tablets with your application and needs root privileges to edit the system/build.prop. So it's not a solution for all, so please do not downvote this little contribute.
EDIT:
I noticed that my tablets have hardware buttons (Home, menĂ¹ and back) on the frames. So Android lets me to hide the system bar. I tryed with other tablets that haven't hardware buttons without success.
Google intends Android to be used for consumers only. They integrated the System UI bar more tightly into Android ICS (4.0) to prevent people from rooting the device and killing the bar that way. Attempting to delete the system bar process will prevent the OS from booting fully.
If you want to restrict users from accessing the home screen, then you are out of luck with Android ICS. I would suggest finding a tablet manufacture who will preload the device with Android 2.3. Either that, or use a rooted Android 3.x device.
If you intend to use Android for kiosk or locked down devices, then you would be better off targeting an OS that is a bit more open.
I found a solution that, in my use case, works like a charm by hiding the menu bar even on a NOT ROOTED device:
setting this flag
layoutparams.flags = 0x80000000 | layoutparams.flags;
to my window's layout parameters simply does the trick!
Here's the complete snippet i used:
Window window = getWindow();
android.view.WindowManager.LayoutParams layoutparams = window.getAttributes();
layoutparams.flags = 0x80000000 | layoutparams.flags;
window.setAttributes(layoutparams);
in my Activity onCreate.
To find out this I reverse engeneered a non-system Apk I found that was somehow able to do that.
According to the official documentation:
http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
that "0x80000000" is the FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS introduced as a system constant in Api level 21, and it basically indicates that "this Window is responsible for drawing the background for the system bars." and since i'm not manually drawing any system bar, no menu bar is shown.
I only tested this on a pair of Moverio BT-200 running Android ICS 4.0.3 because that is the device i'm currently working on and also because right now i don't have other device running Api levels prior to 19 under my hands to test it.
There is a workaround to disable menu bar (not hide) in all most all tablets without rooting. But this is bit tricky, but it works clean. Several well known apps in the market at the moment using this strategy to achieve this disable menu bar feature for their apps.
Grant admin privilege (need one time user involvement to activate).
Set password & lock the device using device admin profile api programatically.
Then load what ever the UIs on top of the native lock screen. (Of course this will show background lock screen whenever a transition happens between activities. But if logic is organized well, then it will be smooth & less noticed by the user)
When need to enable back, reset password to "" using resetPassword("", 0) of device policy manager object.
To complement the answers already given, and in case it is useful for someone needing a similar behaviour, there is this tutorial for android devices 4.0 and higher, it tells you how to hide the navigation bar and the status bar (they will reappear when the screen is touched again):
https://developer.android.com/training/system-ui/navigation.html
I realize it is not what you need exactly, but might be useful for someone else looking at this problem.
I'm trying to fake some information that are shown on the status bar (I'm doing this for a good reason, for example when a thief steels the phone, he doesn't deserve to know the status of anything: battery, WiFi, 3G, GPS, etc...)
I know that this is possible somehow without creating a ROM, see this app in the Android market: CSB Fake
at 2:26 in the video, he fakes the battery level IN THE STATUS BAR!
I really need to know how is this done.
There are only two ways I can think of
at some desired time, change the icon in the system (using superuser permission)
just send wrong information to the status bar, and it does the rest, for example, send to the status bar that the GPS is not working while in fact it is
Is it possible to do it without rooting? (that app seems to do it on no-rooted devices)
How to do such a thing? is there any references or some sites that most likely has the answer?
That screen shown in app for battery you can make that...by making the app full screen mode and show your custom title bar like with wifi level battery level time icons and also pop up one custom dialog for battery low as same as android pops up.
This must be done at build time. The reason for this is because the base level of android has the statusbar code. YOU MUST recompile the ROM there is NO way around this. These are system level broadcasts that are broadcasted within the phone. You cannot control this, even with root its still impossible.
Once again, to do this properly you MUST have code that will allow you to recompile your source code of your phone. A custom rom would suit this.