Hi, I've been having issues with silent retries when consuming a REST API using OkHttpUtils2, with poor cellular connections. And I saw that I can remove these retries by set retryOnConnectionFailure to False.
I found this tip from Erel https://www.b4x.com/android/forum/threads/mysql-problem.80538/post-510207, but I don't know where or how I should apply this code.
I will appreciate any help you can give me.
Regards.
I found this tip from Erel https://www.b4x.com/android/forum/threads/mysql-problem.80538/post-510207, but I don't know where or how I should apply this code.
B4X:
'Replace the existing method in HttpUtils2Service
Sub Initialize
If hc.IsInitialized = False Then
TempFolder = File.DirTemp
Dim jo As JavaObject = hc
Dim builder As JavaObject = jo.RunMethod("sharedInit", Array("hc"))
builder.RunMethod("retryOnConnectionFailure", Array(False))
jo.SetField("client", builder.RunMethod("build", Null))
TaskIdToJob.Initialize
End If
End Sub
I will appreciate any help you can give me.
Regards.