Passing parameter from native android

Hi , I want to pass parameters between my Android native code and my Unity project. I can pass variable from my Unity project to my native android code but I haven’t found a way to pass parameters from my native code to my Unity project.

I’ll appreciate if someone can help me with this.

thanks very much

you can use this method to call a C# (or JS) method in unity with a string parameter:

UnityPlayer.UnitySendMessage(your_gameObject_name, your_method_Name, "message");

if you want to pass more parameter you can call your_method to get more variable:

 // in java

 UnityPlayer.UnitySendMessage(your_gameObject_name, your_method_Name, "Ready");

 //  ...

 public static int int_param;
 public static int getnum(){
      return int_param;
 }

// in C#

public void your_method_Name(string message){
    if (message == "Ready"){
         int param = your_java_class.CallStatic<int>("getnum");
         // ...

    }
}