### About

Inline Java Code is supported as from B4J 2.80 and B4A 4.30.
Information
http://www.b4x.com/android/forum/threads/inline-java-code.50141/
Notes
The main purpose of the inline java feature is to help with integration of third party libraries.
Requires an instance of JavaObject (add Library JavaObject to the project) to access the API methods.
Inline Java Framework
Define in Process_Globals
Private joInlineJava As JavaObject = Me
End Sub
Run Java Object Method
joInlineJava.RunMethod("HelloWorld", Null)
Define JAVA conditional
#If JAVA
public static String HelloWorld() {
return "Hello World!";
}
#End If
Hints
• Methods added must be Public.
• Methods in static code modules must be Public Static.
• Define a Global JavaObject, like Private joInlineJava As JavaObject
• Init joInlineJava using joInlineJava = Me, fast way is declaring Private joInlineJava As JavaObject = Me
• Logging insight Java Conditional Section: System.out.println("Logentry"); or use BA.Log("Logentry");
• If during compile, an error message like error: cannot find symbol, symbol: class Image then ensure to import the class, idc Image.
Examples see B4J HowTo Category Inline Java
• Inline Java UI HelloWorld
• Inline Java UI HelloWorld Mac Look (Third Party Library aquafx)
• Inline Java UI jSch Library (Third Party Library jsch)
• Inline Java NonUI MessageDialog
.. and more.

Changed: , Category: Inline Java, File: T6C201M1470.htm, ID: 1470