Paolodc Member Dec 1, 2020 #1 Hello experts! Can anyone tell me why when my application is released it can't connect to the database? I'm using the JdbcSql library and the connection happens under my private network. However, with debugging it manages to connect. The problem is as follows: (NetworkOnMainThreadException) android.os.NetworkOnMainThreadException. What is the problem and how can I solve it?
Hello experts! Can anyone tell me why when my application is released it can't connect to the database? I'm using the JdbcSql library and the connection happens under my private network. However, with debugging it manages to connect. The problem is as follows: (NetworkOnMainThreadException) android.os.NetworkOnMainThreadException. What is the problem and how can I solve it?
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2020 #2 1. Use the search feature: https://www.b4x.com/search?query=NetworkOnMainThreadException 2. Include the relevant information in your post. I assume that you are not using the async methods. This is a big mistake. Upvote 0
1. Use the search feature: https://www.b4x.com/search?query=NetworkOnMainThreadException 2. Include the relevant information in your post. I assume that you are not using the async methods. This is a big mistake.
Paolodc Member Dec 1, 2020 #3 Thanks Erel. I am not using the asynchronous methods for the moment because I am testing the app. Then when the code is ready I proceed with adding the server and asynchronous methods. Upvote 0
Thanks Erel. I am not using the asynchronous methods for the moment because I am testing the app. Then when the code is ready I proceed with adding the server and asynchronous methods.
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2020 #4 Save yourself the time and start with the correct implementation. Use the async methods. They are very simple to use. [B4X] SQL with Wait For - Upvote 0
Save yourself the time and start with the correct implementation. Use the async methods. They are very simple to use. [B4X] SQL with Wait For -
Paolodc Member Dec 1, 2020 #5 App permitts utents to connect to database. I think that to use async methods I must create a serverSocket. It isn't? Upvote 0
App permitts utents to connect to database. I think that to use async methods I must create a serverSocket. It isn't?
Erel B4X founder Staff member Licensed User Longtime User Dec 1, 2020 #6 No. Read the tutorial linked above. Upvote 0