I know that the threading lib is not recommended at all.
But it's very important for OpenCV work with IP-cameras, that can give big frames latency, and the main window is frozen while waiting for a frame.
Threading is less problematic in B4J than B4A as you don't have to deal with activity lifecycle considerations. Just try using it and see if it does what you want.
Several ways. Probably most convenient is to place the return values in global variables and return from the thread sub. This will raise the Ended event.
I have ported the main B4A example of Threading lib to B4J, it works, but only in Release mode.
So is it not possible to debug an app at all in the debug mode with this lib ?
Correct, although if your threaded code is in a separate class, you can compile that to a library once it's working (not a b4xlib) then use that in your app which you can then debug.
If I remember correctly.
Edit: It will depend on the level of integration whether it will work in your case or not.
You cannot debug a threaded Sub as the debugger knows nothing about threads. If the normal debugger doesn't work in your non-threaded code you could try the legacy debugger - if B4J implements it. I'm away from my computer and can't remember. EDIT: It doesn't!
Can you describe what you are trying to do: Multiple video views on the Main form ? I use the threading lib in a B4J ui app(without issues), you cannot debug the app as everything runs on the main thread in debug mode.
Just reading frames from IP-camera, those are freezing the main window. Single IP camera.
Processing of each frame is about 0.8...1 second (as 200+ image samples to be recognized on a camera frame).
App is big, complex, and debugging in the debug mode is the must.
Threading is widely recommended for OpenCV with IP-cameras, so question is how to use it in B4J with debugging...
Sorry - you can't unless Erel rewrites the debugger. But you should be able to debug the threaded code by running it all unthreaded with the performance hit
Just reading frames from IP-camera, those are freezing the main window. Single IP camera.
Processing of each frame is about 0.8...1 second (as 200+ image samples to be recognized on a camera frame).
App is big, complex, and debugging in the debug mode is the must.
Threading is widely recommended for OpenCV with IP-cameras, so question is how to use it in B4J with debugging...