How to Utilize System API for Full-Screen Display: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
== Overview == | |||
This guide explains how to use specific system APIs to hide the status bar and navigation bar, enabling a full-screen display on Android devices. | |||
== Important Considerations == | |||
Be aware that using these APIs affects the entire system, not just your application. When you hide the status bar or navigation bar, it remains hidden across all system interfaces and applications. | |||
== Permission == | == Permission == | ||
android.permission.CLOUDPOS_HIDE_STATUS_BAR | android.permission.CLOUDPOS_HIDE_STATUS_BAR | ||
Line 46: | Line 48: | ||
Object object = expand.invoke(service); | Object object = expand.invoke(service); | ||
</syntaxhighlight > | </syntaxhighlight > | ||
== Download == | |||
Please download and run [http://ftp.wizarpos.com/advanceSDK/HideStatusBarTest-signed-20180323.apk HideStatusBar Test APK] |
Revision as of 21:19, 9 January 2024
Overview
This guide explains how to use specific system APIs to hide the status bar and navigation bar, enabling a full-screen display on Android devices.
Important Considerations
Be aware that using these APIs affects the entire system, not just your application. When you hide the status bar or navigation bar, it remains hidden across all system interfaces and applications.
Permission
android.permission.CLOUDPOS_HIDE_STATUS_BAR
The application declares permissions in the manifest.
API Overview
void hideBars(int state)
Set status bar and navigation bar state.
Parameters | |
---|---|
state | int: 1 : hide status bar, 2 : hide navigation bar, 3: hide both, 0: show both. In device without navigation bar, set 2 and 3 will throw IllegalArgumentException. |
Here are some code snippets:
//hideBars:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("hideBars", int.class);
method.invoke(service, 3);
GetBarsVisibility
int getBarsVisibility();
Get the state of the status bar and navigation bar.
Returns | |
---|---|
int | The result , 1 : hide status bar, 2 : hide navigation bar, 3: hide both, 0: show both. In device without navigation bar, set 2 and 3 will throw IllegalArgumentException. |
Here are some code snippets:
//getBarsVisibility:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("getBarsVisibility");
Object object = expand.invoke(service);
Download
Please download and run HideStatusBar Test APK