B4J Question [solved]webapp. Is map/list in ThreadSafeMap thread safe? - Erel (first post)    
Mar 5, 2017   
(1 reaction)It is only required when iterating over the elements with For Each....
link: There is a workaround for the nested maps:
Dim m As Map = Main.srvr.CreateThreadSafeMap
m =main...
link: Dim m As Map = Main.srvr.CreateThreadSafeMap
This is the line missing in my code. Nested Thread...
B4J Question [Server] TheadSafeMap and locks - Alessandro71    
Aug 1, 2025some questions about ThreadSafeMap in a jServer environment:
a Map that is loaded once with CreateMap(...) at startup and is used only with Get, does not need to be a ThreadSafeMap, correct?
a Map...
link:
See:
https://www.b4x.com/android/forum/pages/results/?query=ThreadSafeMap
???...
link: /android/forum/pages/results/?query=ThreadSafeMap
and
In Java, ConcurrentHashMap is a class...
link:
In B4J, a Java-based development environment, there is no specific class called ThreadSafeMap like...
B4J Question How to manage concurrent acces to a map - marcick (first post)    
Feb 9, 2022Thank you guys, I have read that article but I'm still confused:
I create a Public ThreadSafeMap in the main code and then ?
How to lock the map between a get and a put ?
How can the second thread know that I have finished or I'm still working with the map ?...
link: ThreadSafeMap in the main code and then ?
How to lock the map between a get and a put ?
How can the second...
link: a ThreadSafeMap enables safe iteration of the values or keys by means of the Values and Keys methods in...
B4J Question [Jserver4] display error and debug logs in an html page? - EnriqueGonzalez (first post)    
Feb 13, 2023   
(1 reaction)
isplay the error and debug logs in an html page with b4j_ws.js
On the chat example. Erel shows how to store Websockets sessions in a map. Those being able to call them whenever an event happens.
The idea is simple.
Create a ThreadSafeMap
Add the session to this map
Every time an error occurs, call a function asynchronously triggering an updated on such websocket session
by Asynchronous i mean CallsubDelayed...
B4J Question How to call CallSubDelayed from a different Class Module - avalle (first post)    
Apr 13, 2020   
(1 reaction)Just wanted to report that after quite a while I've been able to implement the solution #1 based on ThreadSafeMap. It works nicely. Thank you again @OliverA for suggesting this!...
link: that you sent to B and B answer comes with that transaction ID
You can use a ThreadSafeMap. In...
B4J Question Close Websocket Handler - lip (first post)    
Mar 11, 2019No. How are you tracking your connections via your ThreadsafeMap? At every connection... you remove WebSocket information from your ThreadsafeMap when a client times out instead of properly...
link: Should I do this?
No. How are you tracking your connections via your ThreadsafeMap? At every...
link: I maintain a ThreadsafeMap in the Main Activity with an entry in the Map for each Instance...
link: I also created a third ThreadsafeMap which mapped the Wesocket connection's SessionID to...
B4A Tutorial Google Maps - Erel    
Jul 7, 2025   
(36 reactions)://console.developers.google.com
You need to enable Google Maps Android API.
Then click on Credentials ->.../>
)
- Add a MapFragment with the visual designer. It will appear under the CustomView menu. If you don't see it then make sure that the GoogleMaps library is selected.
You can change the properties from the designer.
Set the anchors to BOTH so the map will fill the activity:
https... a reference to the GoogleMap object.
Complete code:
Sub Class_Globals
Private Root As B4XView...
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 and is safe to use):
Sub DisableStrictMode
Dim jo As JavaObject
jo.InitializeStatic...
B4J Question Better use CallSub or CallSubDelayed in server application for websocket? - mauro vicamini    
Feb 18, 2020 I store each object of the websoket class in a map initialized as a ThreadSafeMap.
When I need to call a client method I iterate through the map objects and I call the sub of the websocket class that call the ws.RunFunction method
' in the Main
Sub Process_Globals
Public mapConnection As Map...")
srv.Port = 51042
srv.Start
mapConnection = srv.CreateThreadSafeMap
tmrSeconds... = "somthing to trasmit retrived by a function";
For Each c As WebsocketConnection In mapConnection...
B4J Library jGoogleMaps library - Erel    
May 22, 2025   
(24 reactions)The latest version of Google Maps isn't compatible with JavaFX WebView. Don't use this library.
Alternative solution: https://www.b4x.com/android/forum/threads/jsd_openmaps.166066/#content
This library is similar to B4A and B4i GoogleMaps libraries.
https://www.b4x.com/basic4android... with GoogleMaps JavaScript API V3.
Using the map is quite simple. You need to initialize GoogleMap and then wait for the Ready event.
GoogleMap.AsPane returns the pane that holds the map. You should add...
Page: 1  
2  
3  
4  
5  
6  
7