- Open the AndroidAar folder with Android Studio and build it into an AAR file.
- Create a Unity project by yourself and add the AAR file to your project.
- Copy the three C# scripts from GameScripts folder into your Unity project. The file named DemoMonoBehaviour is a MonoBehaviour class with three serialized buttons, you can create three buttons in your scene and assign them to this script.
- Build your Unity project to an APK, run it on your Android device, click three buttons to observe the results in logcat.
First button, A string is returned from JNI to Java , then form Java to C#, and finally displayed in log. You can see it in logcat:
Second button, a string is sent from C# to Java to C++, and shown in logcat:
Third button, a string is sent from C# to Java, and then Java call C# to send this string back to C#, which is logged in C# as belows:


