Unity android plugin - the template.

Hello! Today I'm going to put here some java code for basic Unity plugin with couple things worth noting. If you haven't seen my YT video about making Unity plugin using only Notepad++, watch it. It's here:
 

 
Since this video was released, I have found a way to get Unity's activity. Activity's class instance is needed to call various methods, so it's important to have reference to it. I couldn't find the way to get one. And finally I found this: import com.unity3d.player.UnityPlayer;.
 
The Template: MyUnityPlugin.java

 
In order to compile this code you have to add path to Unity's classes.jar file to classpath. Keep in mind that there is more than one such file. Typical paths are:
 
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono\Release\Classes
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Release\Classes
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp\Development\Classes
C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono\Development\Classes
 
As you can see it depends on build type (Release / Development) and Scripting Backend (Mono / IL2CPP). The Scripting Backend settings are in:
 
File > Build Settings ... > Player Settings ... > Other Settings > Configuration > Scripting Backend
 
Building bat script could looks like this:

 
On Linux, paths to *.jar files MUST be separated by colon (:) not by semicolon (;) !!!
 
And, of course, the MyUnityPlugin.java must be in com\alientechlab\myunityplugin folders.