B4A Code Snippet Workaround the NetworkOnMainThread exception - Erel    
Apr 10, 2025   
(24 reactions): NetworkOnMainThreadException, strict mode...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...
link: testing client getting getting android.os.networkonmainthreadexception on the httpclient call. Should...
B4A Question Save error: (NetworkOnMainThreadException) android.os.NetworkOnMainThreadException - DonManfred (first post)    
Dec 2, 2025The question in #1 is answered. For any new question you should create a new thread....
link:
No. You are using a workaround.
The real solution is to switch to JdbcSQL and use its async methods...
link:
Problem solved.
No. You are using a workaround.
The real solution is to switch to JdbcSQL and use ...
link:
Hello, check this
Thread
https://www.b4x.com/android/forum/threads/workaround...
B4A Question android.os.NetworkOnMainThreadException - Erel (first post)    
May 19, 2026The best solution is to switch to AsyncStreams and avoid making network communication on the main....b4x.com/android/forum/threads/workaround-the-networkonmainthread-exception.44760/#content...
link: Sub
I got the exception "android.os.NetworkOnMainThreadException" on "out.WriteBytes...
link: ://www.b4x.com/android/forum/threads/workaround-the-networkonmainthread-exception.44760/#content...
link: then put it to the database.
but any error message "android.os.NetworkOnMainThreadException...
B4A Question SMB File Transfer to Server: NetworkOnMainThreadException - Erel (first post)    
Jul 27, 2025   
(1 reaction)The NetworkOnMainThreadException is solved with the DisableStrictMode code. Nothing has changed in... is not one of them.
Some examples:
Sockets: https://www.b4x.com/android/forum/threads/b4x-b4xpages-network-asyncstreams-b4xserializator.119011/#content
MQTT: https://www.b4x.com/android/forum/threads... you want to implement a server: https://www.b4x.com/android/forum/threads/b4x-ftp-server-implemented...
link: : (NetworkOnMainThreadException) android.os.NetworkOnMainThreadException
I searched the forum and...
B4A Question jkSSH2: android.os.NetworkOnMainThreadException - devcitizen    
Jul 9, 2020 version 1.10. The same NetworkOnMainThreadException (newer Android sdk levels will not permit networking in the main ui thread) is already fixed for the HttpUtils2 library. Is there any way for me to use...
link:
Check this post
Why are you posting to a 11 years old thread? It is a mistake to do this....
link: -exception.44760/
It will prevent the error and crash by allowing network on main....
link: http://www.b4x.com/android/forum/threads/workaround-the-networkonmainthread-exception.44760...
B4A Question android > 4.0 NetworkOnMainThreadException error help - Spinter    
Jul 9, 2020I'm using HttpRequest to communicate with my mysql but with a device SDK 2.2 everything works perfectly! device with a 4.0 sdk I go to NetworkOnMainThreadException.
How do I get out?
22280...
link: /forum/threads/remote-database-connector-connect-to-any-remote-db.31540/#content
You also need to make...
link: Sure, here is my config file
25301
However inside the jdbc_driver folder there is a conf folder i...
link: Can you post your config file?...
B4A Question How to solve "android.os.NetworkOnMainThreadException" error - DanteS (first post)    
Apr 26, 2024   
(1 reaction)Thanks to all that sugested, insisted and demmanded the use of the okHtmlUtils. Specially JohnC, who...
link:
Thanks JohnC
It looks very well.
Is it necesary to add some library?
I think just the OKHttpUtils...
link: Thanks JohnC
It looks very well.
Is it necesary to add some library?...
link: .os.NetworkOnMainThreadException
This error occurs because your app is performing a network operation...
B4A Question NetworkOnMainThreadException Error Message in Android Device - junaidahmed    
Oct 19, 2016I have developed Android application to get data access from Sql server using Http Client.Its workin...
link: Actually I have developed my project using "http lib" in the year of 2012,but when I run m...
link: whether this lib will work or not ?
with b4a 6+ it works 100%.
with b4a 2.3 i dont think it will wor...
link: I am going to clarify only.whether this lib will work or not ????
anyhow we are planning to update ...
B4A Question NetworkOnMainThreadException on higher SDK's - bluedude    
Jan 24, 2012 documentation: NetworkOnMainThreadException | Android Developers
Higher SDK's shouldn't do networking anymore on the main thread. How can we solve this issue?...
link: Erel,
Solved the problem for now. As always I should listen to you, rewritten the response stuff to...
link: I know but what if I want to use newer API stuff?
Which new API are you using?...
link: I know but what if I want to use newer API stuff? So I guess I need to do my test cycle again with A...
B4A Question NetworkOnMainThreadException problem. How I can continue? - Erel (first post)    
Dec 1, 2020No. Read the tutorial linked above....
link: App permitts utents to connect to database. I think that to use async methods I must create a server...
link: Save yourself the time and start with the correct implementation. Use the async methods. They are ve...
link: Thanks Erel.
I am not using the asynchronous methods for the moment because I am testing the app. Th...
Page: 1  
2  
3  
4  
5  
6  
7