Hi all,
I'm in the process of converting a huge B4J Windows-only project to B4XPages and then Android.
The original project had a Static Module used as a "repository" for common variables and functions (even those requiring events).
First step was to define a Standard Class and copy everything from the static module to it (so that http jobs could work)
The clsCommon class is initialized in the Starter service. I added the following line:
B4XPages.GlobalContext = AppGlobals
where AppGlobals is the instance of the clsClass as defined in the Starter module.
Question: how do I call a function in that class (e.g SilentSync)?
Wait For(B4XPages.GlobalContext.SilentSync) Complete (Result As Object)
gives error while
Wait For(Starter.AppGlobals..SilentSync) Complete (Result As Object)
looks not the right way to keep B4A and B4J aligned.
Note: I can think of many ways to "solve the problem" and have a working app, but I'd like to learn how to use this specific object (GlobalContext) and write code thts' almost 100% shared between B4A and B4J. Thank you for your help.
I'm in the process of converting a huge B4J Windows-only project to B4XPages and then Android.
The original project had a Static Module used as a "repository" for common variables and functions (even those requiring events).
First step was to define a Standard Class and copy everything from the static module to it (so that http jobs could work)
The clsCommon class is initialized in the Starter service. I added the following line:
B4XPages.GlobalContext = AppGlobals
where AppGlobals is the instance of the clsClass as defined in the Starter module.
Question: how do I call a function in that class (e.g SilentSync)?
Wait For(B4XPages.GlobalContext.SilentSync) Complete (Result As Object)
gives error while
Wait For(Starter.AppGlobals..SilentSync) Complete (Result As Object)
looks not the right way to keep B4A and B4J aligned.
Note: I can think of many ways to "solve the problem" and have a working app, but I'd like to learn how to use this specific object (GlobalContext) and write code thts' almost 100% shared between B4A and B4J. Thank you for your help.