There are two types of modules in B4i: static modules and classes.
A class is a template. At runtime you can create any number of instances based on the class template.
Each instance will have its own set of global variables (its state).
You must call the class Initialize method before you call any other methods of the class. Note that you can change the Initialize sub signature as needed.
Static modules can be considered singleton classes or a template with exactly one instance (with the same name).
Unlike B4A (and like B4J) static modules can handle events.
If you are converting a B4A project to B4i then B4A activities and services should be converted to static modules.
Note that you don't need to use CallSub or CallSubDelayed to interact with subs in other modules. You can call them directly.
The program structure is more flexible than in B4A as you don't need to create a new module for each Page. However that means that you need to pay more attention to your program architecture.
A class is a template. At runtime you can create any number of instances based on the class template.
Each instance will have its own set of global variables (its state).
You must call the class Initialize method before you call any other methods of the class. Note that you can change the Initialize sub signature as needed.
Static modules can be considered singleton classes or a template with exactly one instance (with the same name).
Unlike B4A (and like B4J) static modules can handle events.
If you are converting a B4A project to B4i then B4A activities and services should be converted to static modules.
Note that you don't need to use CallSub or CallSubDelayed to interact with subs in other modules. You can call them directly.
The program structure is more flexible than in B4A as you don't need to create a new module for each Page. However that means that you need to pay more attention to your program architecture.