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.
[null,null,["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,["# Initialization (Android only)\n=============================\n\nThis module initializes the JavaVM and Android context.\n\nSummary\n-------\n\nImportant: This function is only used by Android and it's mandatory to call this function before using any other Cardboard APIs.\n\n| ### Functions ||\n|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------|\n| [Cardboard_initializeAndroid](#group__initialization_1gaf3bcb627b96ad8045ef58e5ab6d6b04f)`(JavaVM *vm, jobject context)` | `void` Initializes the JavaVM and Android context. |\n\nFunctions\n---------\n\n### Cardboard_initializeAndroid\n\n```scdoc\nvoid Cardboard_initializeAndroid(\n JavaVM *vm,\n jobject context\n)\n``` \nInitializes the JavaVM and Android context.\n\nThe following methods are required to work for the parameter `context:`\n\n\n- [Context.getFilesDir()](https://developer.android.com/reference/android/content/Context#getFilesDir())\n- [Context.getResources()](https://developer.android.com/reference/android/content/Context#getResources())\n- [Context.getSystemService(Context.WINDOW_SERVICE)](https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String))\n- [Context.startActivity(Intent)](https://developer.android.com/reference/android/content/Context#startActivity(android.content.Intent))\n- [Context.getDisplay()](https://developer.android.com/reference/android/content/Context#getDisplay())\n\n\u003cbr /\u003e\n\n`vm` Must not be null. `context` Must not be null. When it is unmet a call to this function results in a no-op.\n\n| Details ||\n|------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------|---------------------------------------------------------------------------------| | `vm` | JavaVM pointer | | `context` | The current Android Context. It is generally an Activity instance or wraps one. | |"]]