B4A Code Snippet Workaround the NetworkOnMainThread exception - Erel    Apr 10, 2025   (24 reactions) Android 4+ doesn't allow applications to make network calls on the main thread. There is a good... network calls with background threads. If you encounter a library that doesn't do it then you have two options: 1. Use the Threading library to start a background thread and make the calls from this thread. 2. Disable this check. The code posted here disables this check (it only calls public APIs... As JavaObject policy = policy.InitializeNewInstance("android.os.StrictMode.ThreadPolicy.Builder... B4J Tutorial [WebApp] Chatroom - Threads, Sessions and Server events - Erel    Oct 19, 2017   (9 reactions) , Null) End If Threads Each WebSocket class instance runs in a different thread (in release mode... be executed on the target object thread. This allows us to safely call subs in other modules or....Flush End Sub The code in code modules will run in the main thread if we call... Italian thread vaffa - ivanomonti    Apr 21, 2018 perché ci litigo sempre e vincono loro,,,, cazzzz chi ha un esempio finito per lanciare un sub da thread separato del mainform, ringrazio anticipatamente... Java Question Tip about BA.raiseEventFromDifferentThread - Erel    Apr 30, 2012   (1 reaction) BA.raiseEventFromDifferentThread is usually used in a multithreaded library to raise an event. It works by sending a message to the main thread messages queue. However it can also be useful in the case of a single threaded library (any library that doesn't start a new thread or uses the internal thread pool). Regular events are only handled when the activity is active (or service). In most cases code running in the main thread is not expected to raise events while the activity... B4A Library Threading library - agraham    Jun 23, 2012   (16 reactions)   tags: thread This library lets you run Basic4android Subs on separate threads to the main GUI thread. It also contains a Lock (semaphore) object that can be used for resource access arbitration and thread synchronisation. Included is also an enhanced Exception object to give more information on any Exception caught. This can also rethrow those caught Exceptions and can create new Exceptions to throw. EDIT :- Version 1.1 posted. See post #13 for details.... Games [XUI2D] Example Pack - Erel    Oct 2, 2022   (33 reactions)   tags: example games, XUI2D Games Updated thread based on X2 v2.0+: https://www.b4x.com/android/forum/threads/xui2d-x2-v2-0-2021.131279/ Examples: - Hello world (based on Tiled) - Clumsy bird - Mario - Space Invaders - Walking Character - Tiles Map - Joints 1 - Tank Attack - Monster Truck - Ilan's First App - Drawing lines....zip Some of the B4A examples depend on Gestures library: https://www.b4x.com/android/forum/threads... a new thread, in the Games forum, if you have a question about any of the examples.... B4J Question [Server] CurrentThreadIndex in SingleThreadHandler - Alessandro71    Aug 5, 2025 Is Main.srvr.CurrentThreadIndex always 0 during execution of an Handler defined with SingleThreadHandler=True ?
rationale for the question is: writing a general purpose handling sub that needs to count different stats if called from a SingleTreadHandler rather than a standard Handler... B4A Library RubikCube - See post #6 of this thread - Johan Schoeman    Apr 23, 2022   (23 reactions) EDIT 21/03/2022: Go to post #6 for a project that can also automatically solve a scrambled cube A "partial" wrap for this Github project. Extract and copy the library files (jars and xml) to your additional library folder (B4A). Attached: Java code - change it to your liking B4A sample project B4A libs - extract and copy to your additional libs folder. LibRes (attached) should be on t... B4J Question Threading library for OpenCV - peacemaker    Nov 9, 2021 HI, All 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. How to be? how to use the lib correctly in B4J ?... B4J Question [Server] AddHandler with SingleThreadHandler = True - Alessandro71    Aug 3, 2025 I need to run a server handler in single thread mode.
I see that when a request is sent to that handler, and the previous execution is not finished yet, the second request is paused until the first... Page: 1   2   3   4   5   6   7   |