How to build a Java plugin in Unity?
Once you have built your Java plugin (.jar) you should copy it to the Assets->Plugins->Android folder in the Unity project. Unity will package your .class files together with the rest of the Java code and then access the code using the Java Native Interface (JNI).
Where to find classes.jar in Unity Android?
To do this, first locate the classes.jar shipped with Unity Android. It is found in the installation folder (usually C:\\Program Files\\Unity\\Editor\\Data (on Windows) or /Applications/Unity (on Mac)) in a sub-folder called PlaybackEngines/AndroidPlayer/Variations/mono or il2cpp/Development or Release/Classes/.
Can you make a unity app for Android?
With Unity Android it is possible to extend the standard UnityPlayerActivity class (the primary Java class for the Unity Player on Android, similar to AppController.mm on Unity iOS). An application can override any and all of the basic interaction between Android OS and Unity Android.
Where to put unity plugins in Android player?
Unity automatically picks the right plugin for the target platform and includes it with the player. For specific Android platform (armv7, x86), the libraries (lib*.so) should be placed in the following: The Android plugin mechanism also allows Java to be used to enable interaction with the Android OS.
How is the JNI used in Unity app?
Unity will package your .class files together with the rest of the Java code and then access the code using the Java Native Interface (JNI). JNI is used both when calling native code from Java and when interacting with Java (or the JavaVM) from native code.
Which is an instance of unityengine.androidjavaclass?
Instances of UnityEngine.AndroidJavaObject and UnityEngine.AndroidJavaClass have a one-to-one mapping to an instance of java.lang.Object and java.lang.Class (or subclasses thereof) on the Java side, respectively. They essentially provide 3 types of interaction with the Java side:-