Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


GetRawObject()

Retrieves the raw jobject pointer to the Java object. Note: Using raw JNI functions requires advanced knowledge of the Android Java Native Interface (JNI).
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.AndroidJNIModule
public nint GetRawObject()

Returns

Type

Description

IntPtr

Remarks

Additional Resources: AndroidJavaObject.GetRawClass

Examples

using System;using UnityEngine;public class AndroidJavaObjectGetRawObjectExample: MonoBehaviour{ void Start() { using (AndroidJavaObject javaObject = new AndroidJavaObject("com.example.exampleunityplugin.ExampleJavaClass")) { IntPtr rawObject = javaObject.GetRawObject(); string message = javaObject.Call<string>("getMessage"); Debug.Log("Message: " + message + " Pointer: "+ rawObject); } }}