Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


AndroidJavaObject

AndroidJavaObject is the Unity representation of a generic instance of java.lang.Object.
Read time 1 minuteLast updated 4 days ago

Definition

public class AndroidJavaObject : IDisposable

Remarks

It can be used as type-less interface to an instance of any Java class. Note: this API can be used from custom thread, but requires that thread to be attached to JVM first, see AndroidJNI.AttachCurrentThread.

Constructors

Constructor

Description

AndroidJavaObject(System.IntPtr)Create AndroidJavaObject for existing Java object.
AndroidJavaObject(System.IntPtr,System.IntPtr,System.Object[])Create AndroidJavaObject (and it's Java counterpart) using given Java class and constructor.
AndroidJavaObject(System.String,System.Object[])Construct an AndroidJavaObject based on the name of the class.
AndroidJavaObject(System.String,System.String[])Construct an AndroidJavaObject based on the name of the class.
AndroidJavaObject(System.String,UnityEngine.AndroidJavaClass[])Construct an AndroidJavaObject based on the name of the class.
AndroidJavaObject(System.String,UnityEngine.AndroidJavaObject[])Construct an AndroidJavaObject based on the name of the class.
AndroidJavaObject(System.String,UnityEngine.AndroidJavaProxy[])Construct an AndroidJavaObject based on the name of the class.
AndroidJavaObject(System.String,UnityEngine.AndroidJavaRunnable[])Construct an AndroidJavaObject based on the name of the class.

Methods

Method

Description

CallCalls a Java method on an object (non-static).
CallStaticCall a static Java method on a class.
CloneReferenceCreates a clone of the C# object that references the same Java object.
DisposeIDisposable callback.
GetGet the value of a field in an object (non-static).
GetRawClassRetrieves the raw jclass pointer to the Java class.
GetRawObjectRetrieves the raw jobject pointer to the Java object.
GetStaticGet the value of a static field in an object type.
SetSet the value of a field in an object (non-static).
SetStaticSet the value of a static field in an object type.