Android Question okHTTP strategy for bad mobile internet

peacemaker

Expert
Licensed User
Longtime User
Hi, All

Who tried and resolved the trouble with client-server systems where client B4A app is working with the server via really bad mobile Internet connection ?

Not slow and stable - but really bad, when Internet is formally connected, exists, but HttpJob returns errors like:
B4X:
javax.net.ssl.SSLHandshakeException: Handshake failed

ResponseError. Reason: java.net.SocketTimeoutException: SSL handshake timed out

ResponseError. Reason: java.net.UnknownHostException: Unable to resolve host ....

Some DNS errors

I mean errors that not from the destination server, but from HTTP Android stack.

If app has the database with several tables, it makes HTTP requests to a server API one by one, collecting data into these tables. But if Internet connection is mobile over a week signal - any time any HTTP error may occure, and the database table will be empty, and the app cannot allow to open next Activity to show the data (that is not loaded).

And if some background HTTP request (to get some data to a next table) is failed - it will give extra errors later due to no data for use next from this (empty) table.

How should such situation be programmed correctly ?
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…