Hi to All
I have some java code that might be useful in my project. I was thinking to insert it with the "#if JAVA ... #end if" paradigm.
As a first step, I created a B4XPages project and just copied the example found in a post here ( besides my situation is more complicate). But even first trial didn't work. So I am missing something very basic, I guess..
The result is that the "FirstMethod is not found". The code is :
By the way my needs are to call a function like the following:
I have some java code that might be useful in my project. I was thinking to insert it with the "#if JAVA ... #end if" paradigm.
As a first step, I created a B4XPages project and just copied the example found in a post here ( besides my situation is more complicate). But even first trial didn't work. So I am missing something very basic, I guess..
The result is that the "FirstMethod is not found". The code is :
B4X:
Sub Class_Globals
Private Root As B4XView
Private xui As XUI
Private NativeMe As JavaObject
End Sub
Public Sub Initialize
' B4XPages.GetManager.LogEvents = True
End Sub
'This event will be called once, before the page becomes visible.
Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
End Sub
Private Sub Button1_Click
NativeMe.InitializeContext
Dim s As String = NativeMe.RunMethod("FirstMethod", Null)
Log(s)
End Sub
#If JAVA
public String FirstMethod() {
return "Hello World!";
}
#End if
By the way my needs are to call a function like the following:
B4X:
class xxx
{
public static List<Integer> YYY(double[] data1, int[] data2 , int aaa)
{
List<Integer> LLL = new ArrayList<>();
return LLL;
}
}