B4J Question B4J "scripting" support for UI applications?

m4.s

Member
Licensed User
Longtime User
Maybe an odd question, but think 1990's desktop software that supported embedded macros and wizards, written by users to extend/enhance out-of-the-box functionality...

B4J supports inline Java code, to perform some things that B4J can't. {Albeit I've personally never used this powerful feature, to-date at least.}

Yet I've not seen any forum threads that ask whether B4J code, written by B4J application users (i.e. not by developers, like B4J libraries and custom views are), can be interpreted or compiled on-the-fly and yield UI controls -- and trigger their related event code too (again, as written by users) -- added to a specified pane in the [parent] B4J application?

I assume the answer is "No". If so, then alternatively could a Java code file written by a B4J application user be dynamically loaded from a non-app directory (and compiled in memory) to accomplish the same?

If that's a second "No", then can a B4J-generated .jar file be dynamically called and executed from a parent B4J application (and visually attach itself to a specified [child] pane displayed within the parent application)?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4J supports inline Java code, to perform some things that B4J can't. {Albeit I've personally never used this powerful feature, to-date at least.}
Not really related. The inline java code is compiled together with the Java code generated from the B4J code.

I assume the answer is "No".
That's correct.

It is possible to load jars at runtime. Example: https://www.b4x.com/android/forum/threads/abplugin-live-plugin-library-for-your-apps.67395/#content
 
Upvote 0

alwaysbusy

Expert
Licensed User
Longtime User
I once did an experiment ABPlugin. Not sure if it still works.


Alwaysbusy
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
The syntax is not quite B4J code but it's close being based on the non-object oriented common ancestor - Basic4ppc. I've used the B4A equivalent library to implement an on-device IDE, including UI elements and events. It should be easy to do a similar thing with B4J.
 
Upvote 0

xulihang

Active Member
Licensed User
Longtime User
I know a java project called OmageT which uses groovy and javascript to write scripts. I don't know if it can be done in B4J as well.
 
Upvote 0

m4.s

Member
Licensed User
Longtime User
Thanks to all those members who provided feedback. Unfortunately, nothing really fits/addresses my requirements - so I will implement this functionality in my B4J application via an alternative custom solution; first via a proof-of-concept (POC), which will likely warrant some future forum questions!
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…