B4J Question Internet Download with progress?

Status
Not open for further replies.

Midimaster

Active Member
Licensed User
I saw, that OkHttp2Utils can also be used to download big file of 100MB with
B4X:
    Dim Link As String= InternetFolder & FileName
    Dim MyJob As  HttpJob
    MyJob.Initialize("", Me)
    MyJob.Download(Link)

    Wait For (MyJob) JobDone(MyJob As HttpJob)
    If MyJob.Success Then
        ....

The code is very simple compared to myold way of using OkHttpRequest:
B4X:
    Dim Request As  OkHttpRequest
    MyHttp.Initialize("MyHttp")
    Request.InitializeGet(InternetFolder & FileName)
    FileNameOfTask(1)=FileName
    MyHttp.Execute(Request,1)
    Log(" http start")
End Sub

Private Sub MyHttp_ResponseSuccess (Response As OkHttpResponse, TaskId As Int)
    Log(" http response =" & Response.ContentLength )
        ....

But I do not read anything about of reporting a progress in the first methode. Is it not possible?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
 
Upvote 0
Status
Not open for further replies.
Top