- Qt 6.9
- Qt Core
- C++ Classes
- QAndroidApplication
- Qt 6.9.2 Reference Documentation

# QNativeInterface::QAndroidApplication Struct

Native interface to a core application on Android. More...

Header: | `#include <QCoreApplication>`
CMake: | `find_package(Qt6 REQUIRED COMPONENTS Core)` `target_link_libraries(mytarget PRIVATE Qt6::Core)`
qmake: | `QT += core`
Since: | Qt 6.2

- List of all members, including inherited members

## Static Public Members

`(since 6.2)` QJniObject | context()
`(since 6.2)` void | hideSplashScreen(int duration = 0)
`(since 6.2)` bool | isActivityContext()
`(since 6.2)` int | sdkVersion()

## Detailed Description

Accessed through QCoreApplication::nativeInterface().

## Member Function Documentation

### `[static, since 6.2]` QJniObject QAndroidApplication::context()

Returns the Android context as a `QJniObject`. The context is an `Activity` if the most recently started activity object is valid. Otherwise, the context is a `Service`.

This function was introduced in Qt 6.2.

### `[static, since 6.2]` void QAndroidApplication::hideSplashScreen(int duration = 0)

Hides the splash screen by using a fade effect for the given duration. If duration is not provided (default is 0) the splash screen is hidden immedetiately after the app starts.

This function was introduced in Qt 6.2.

### `[static, since 6.2]` bool QAndroidApplication::isActivityContext()

Returns `true` if QAndroidApplication::context() provides an `Activity` context.

This function was introduced in Qt 6.2.

### `[static, since 6.2]` int QAndroidApplication::sdkVersion()

Returns the Android SDK version. This is also known as the API level.

This function was introduced in Qt 6.2.