AndroidApplication class
Main entry point and handler for Android applications.
Specializes Application for the Android platform, wiring the engine to the android_native_app_glue lifecycle and dispatching the platform commands it receives.
Base classes
- class Application
- Base class for the main entry point of an nCine application.
Public static functions
- static void Run(struct android_app* state, CreateAppEventHandlerDelegate createAppEventHandler)
- Entry point method to be called in the
android_main()function. -
static void ProcessCommand(struct android_app* state,
std::
int32_t cmd) - Processes an Android application lifecycle command.
Public functions
- auto IsInitialized() const -> bool
- Returns
trueif the application has already called Init(). - auto IsScreenRound() const -> bool
- Returns
trueif the main screen is round. - auto OpenUrl(StringView url) -> bool override
- Opens the specified URL in a default web browser.
- void HandleBackInvoked()
- Handles invocation of the system Back gesture.
- void HandleIntent(StringView action, StringView uri)
- Handles the intent sent to the application activity.
- void HandleContentBoundsChanged(Recti bounds)
- Handles changes of content bounds.
- auto CanShowScreenKeyboard() -> bool override
- Returns
trueif screen (software) keyboard is supported and ShowScreenKeyboard() should succeed. - auto ToggleScreenKeyboard() -> bool override
- Toggles the screen (software) keyboard.
- auto ShowScreenKeyboard() -> bool override
- Shows the screen (software) keyboard.
- auto HideScreenKeyboard() -> bool override
- Hides the screen (software) keyboard.
-
void Vibrate(std::
int32_t milliseconds) override - Vibrates the device for the specified duration in milliseconds; no-op if not supported.
- void ShowStatusBar() override
- Shows the system status bar (if supported).
- void HideStatusBar() override
- Hides the system status bar (if supported).
Friends
- auto theApplication() -> Application&
- Returns the application instance.
Function documentation
static void nCine:: AndroidApplication:: Run(struct android_app* state,
CreateAppEventHandlerDelegate createAppEventHandler)
Entry point method to be called in the android_main() function.
| Parameters | |
|---|---|
| state | Native application state provided by the glue layer |
| createAppEventHandler | Factory delegate that creates the application's event handler |
static void nCine:: AndroidApplication:: ProcessCommand(struct android_app* state,
std:: int32_t cmd)
Processes an Android application lifecycle command.
| Parameters | |
|---|---|
| state | Native application state provided by the glue layer |
| cmd | One of the APP_CMD_* commands dispatched by the glue layer |
void nCine:: AndroidApplication:: HandleIntent(StringView action,
StringView uri)
Handles the intent sent to the application activity.
| Parameters | |
|---|---|
| action | Intent action string |
| uri | Intent data URI |
void nCine:: AndroidApplication:: HandleContentBoundsChanged(Recti bounds)
Handles changes of content bounds.
| Parameters | |
|---|---|
| bounds | New content bounds, accounting for insets such as display cutouts |
Application& theApplication()
Returns the application instance.
Returns the singleton application instance.