B4J Question Timer works in class module, but not when compiled to lib

Dan Haugland

Member
Licensed User
I have a class module that initializes a timer in the _initialize, and when another method is called enables the timer. I have logging in the _Tick callback, and the method that enables it. When compiling the class into the app, everything works fine, but if I compile the class to a lib and then tell my app to use that...the timer never fire. Why might that be?
 

Dan Haugland

Member
Licensed User
2 files. bcn is the stripped down class, bcl is the stripped ui that uses it. If compiled to a lib, the timer in the class never ticks. If you include the module in bcl directly, it does.
 

Attachments

  • bcl.zip
    826 bytes · Views: 182
  • bcn.zip
    1.1 KB · Views: 178
Upvote 0

Dan Haugland

Member
Licensed User
That's easy to fix, thank you. Actually, is the opposite true as well? If I build it in a UI can I use it in a non-ui app?
 
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
If I build it in a UI can I use it in a non-ui app?
No.

If you need to use the libraries from both a UI and non-Ui applications then you can put the library modules in the shared modules folder and create two projects (UI and non-UI) that use these modules. Now you can create a library for each version.

This is how OkHttpUtils2 is compiled.
 
Upvote 0
Top