Stay organized with collections
Save and categorize content based on your preferences.
Initialization (Android only)
This module initializes the JavaVM and Android context.
Summary
Important: This function is only used by Android and it's mandatory to call this function before using any other Cardboard APIs.
Functions
Cardboard_initializeAndroid
void Cardboard_initializeAndroid(
JavaVM *vm,
jobject context
)
Initializes the JavaVM and Android context.
The following methods are required to work for the parameter context:
vm
Must not be null. context
Must not be null. When it is unmet a call to this function results in a no-op.
Details |
Parameters |
vm
|
JavaVM pointer
|
context
|
The current Android Context. It is generally an Activity instance or wraps one.
|
|
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["The `Cardboard_initializeAndroid` function is crucial for initializing the Java Virtual Machine (JVM) and Android context, and it must be called before using any other Cardboard APIs on Android."],["This initialization is exclusively for Android and requires a valid JavaVM pointer and an Android Context, typically an Activity instance or a wrapper."],["For successful initialization, the provided Android Context must support specific methods like `getFilesDir()`, `getResources()`, `getSystemService()`, `startActivity()`, and `getDisplay()`."],["If either the JavaVM pointer or the Android Context is null, the `Cardboard_initializeAndroid` function will not perform any action (no-op)."]]],[]]