Android Question Problem with OkHttp and OkHttpUtils2

hatzisn

Well-Known Member
Licensed User
Longtime User
Hi all, I am facing a problem with these two libraries...
My code is the following:

B4X:
Sub GetHTML()
    Dim hj As HttpJob
    hj.Initialize("job1", Me)
    hj.Download("http://......")
End Sub

Sub JobDone(job As HttpJob)
    If job.Success Then
        If job.JobName = "job1" Then
            UpdateHTML(job.GetString)
        End If
    Else
        ToastMessageShow("Job not succeded",False)
    End If
End Sub

The sub GetHTML executes without a problem. It never gets to the JobDone sub.
Instead I get this error:

Untitled.png


When I switch back to HTTP and HttpUtils2 everything works fine.

My B4A version is 3.82 and SDK engine is 4.0.2 ICS_MR0.

Thanks in advance for any help.
 
Last edited:

hatzisn

Well-Known Member
Licensed User
Longtime User
Erel, any suggestions?
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
It is a very small project. Just one activity and nothing more. All my internet access code is the code given bellow. What do you mean I did not replaced them completely? I unticked the HTTP and Httputils2 and I ticked the OkHttp (version 1.01) and OkHttpUtils2 (version 2.20). What else was I supposed to do?

P.S. If I was supposed to do anything more please write it here or else I wouldn't like to upload my project here. Please send me an e-mail to [email protected] to send it to your e-mail.
 
Upvote 0

hatzisn

Well-Known Member
Licensed User
Longtime User
Thanks Erel. Now it works with the source code and I only have problem with the Postmultipart sub which contains strings divided into several lines and with dollar signs. I don't need it and I commented that out... Thanks.
 
Last edited:
Upvote 0
Top