# Display Full-Screen API

### 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

```xml
 android.permission.CLOUDPOS_HIDE_STATUS_BAR
```

The application declares permissions in the manifest.

### API Overview

#### Hide or show status/navigation bar using HideBars

{% code overflow="wrap" %}

```java
void hideBars(int state)
```

{% endcode %}

Set status bar and navigation bar state.

| Parameters |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| state      | 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.* 11 - Automatically hide the status bar globally (can be pulled down), 12 - Automatically hide the navigation bar globally (can be pulled up), 13 - Automatically hide all globally (can be pulled down and up), 22 - Globally hide the status bar and automatically hide the navigation bar (can be pulled up), 23 - Automatically hide the status bar globally (can be pulled down) and hide the navigation bar |

Here are some code snippets:

{% code overflow="wrap" lineNumbers="true" %}

```java
//hideBars:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("hideBars", int.class);
method.invoke(service, 3);
```

{% endcode %}

#### GetBarsVisibility

{% code overflow="wrap" %}

```java
int getBarsVisibility();
```

{% endcode %}

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:

{% code overflow="wrap" lineNumbers="true" %}

```java
//getBarsVisibility:
Object service = getSystemService("statusbar");
Class statusBarManager = Class.forName("android.app.StatusBarManager");
Method method = statusBarManager.getMethod("getBarsVisibility");
Object object = expand.invoke(service);
```

{% endcode %}

### Download

Please download and run [HideStatusBar Test APK](https://ftp.wizarpos.com/advanceSDK/HideStatusBarTest-signed-20180323.apk)

Please download the [source demo](https://github.com/SmartPOSSamples/StatusBarDemo.git).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://smartpossdk.gitbook.io/cloudpossdk/faq/advance-sdk/display-full-screen-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
