So I have this .jar file, which will call a UI window that have in App payment function for Android.
Inside .jar file, it has Two Static functions that I need to call. One is going to call the activities using Intent which initiate the variables, creating the layout and the other will be calling the UI Window that has the function.
I have already put the jar file inside the assets/android/plugins folder and in Unity Script, I write the code like this:
// Use this for initialization
void Start () {
AndroidJNI.AttachCurrentThread();
using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) {
using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity")) {
AndroidJavaClass cls_MainActivity = new AndroidJavaClass ("com.test.user.MainActivity");
cls_MainActivity.CallStatic ("InitFunction", obj_Activity, "LAKDJFADF", "ZCVZCXV");
cls_MainActivity.CallStatic ("BuyItem", "Horray", "100", "10");
}
}
}
When I build and run it on android device, it results in nothing. Please help