I am developing an application for tablet only, where the requirement is to run the app on the full screen of the tablet.
For this I have used following code in my main activity:
getWindow().requestFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
This code snippet only removes the title bar and action bar. But in tablets, there is a bottom system bar (having home and back button). I also want to remove or hide this system bar too.
I have searched but there is only following solution:
- There is no API to remove or hide the system bar.
- You can use some android app to hide system bar. (for example: surelock, hidebar, etc)
My question is :
- Is it really not possible in android?
- Above available app (i.e surelock, hide bar, etc) also hiding bar. It means they are using something to do so. Can be use this something in our app so the user will not require to download these app seperatly.
Please guide me.
I know this is not a good idea. But My app is only for tablet having Android 4.0 or greater and that tablet will run only this single app so we do not need to go back and use home button. That's why my requirement is to use the app in full screen.
From Android API 4.0 and later you can use the following code to hide the bottom system bar.
This is not possible unless you've root access. Alternatively, you can create a
launcher application
.Otherwise it will be beyond the scope of your Application to Hide System/Navigation bar.
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:
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:
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.
If you have root access you can use this code other wise it is not allowed
See this