B4J Question What class name should be used in JavaObject, for inline?


Active Member
Licensed User
Longtime User

If we're just testing some functionality in a non-ui app, no events, how do we initialize the JavaObject? The method is inside the B4J code, so I'm not clear on what the Class Name should be.

A simple example,

Dim sResult As String = ""

public static String WhoDat() {
   return "Who Dat?";
#End If

' What goes here?  Which inititialize method from the JavaObject library should be used, and what is the class name?

' jo_WhatThe.InitializeStatic( "WHAT CLASS NAME GOES HERE?" )

sResult = jo_WhatThe.RunMethod( "WhoDat", Null )

Or if the method is not static, then what should be the classname in the InitializeNewInstance method?

Sorry if this should be obvious, but every example out there, seems to be assuming a graphic interface and events, and depends on Activity_Create.


Licensed User
Longtime User
You have to set the JavaObject to Me
dim jo as JavaObject = Me
then use jo.runmethod("whatever",null) etc
Upvote 0