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."],[[["\u003cp\u003eThe \u003ccode\u003eCardboard_initializeAndroid\u003c/code\u003e 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.\u003c/p\u003e\n"],["\u003cp\u003eThis initialization is exclusively for Android and requires a valid JavaVM pointer and an Android Context, typically an Activity instance or a wrapper.\u003c/p\u003e\n"],["\u003cp\u003eFor successful initialization, the provided Android Context must support specific methods like \u003ccode\u003egetFilesDir()\u003c/code\u003e, \u003ccode\u003egetResources()\u003c/code\u003e, \u003ccode\u003egetSystemService()\u003c/code\u003e, \u003ccode\u003estartActivity()\u003c/code\u003e, and \u003ccode\u003egetDisplay()\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIf either the JavaVM pointer or the Android Context is null, the \u003ccode\u003eCardboard_initializeAndroid\u003c/code\u003e function will not perform any action (no-op).\u003c/p\u003e\n"]]],[],null,[]]