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?
Better to use: https://www.b4x.com/android/forum/threads/simple-progress-http-download.127214/#post-796463 The attached project includes a slightly modified version of HttpUtils2 and a new service named DownloadService. The purpose of DownloadService is to make it simple to download files of...
Better to use: https://www.b4x.com/android/forum/threads/simple-progress-http-download.127214/#post-796463 The attached project includes a slightly modified version of HttpUtils2 and a new service named DownloadService. The purpose of DownloadService is to make it simple to download files of...