Android Tutorial Download huge files with HttpUtils2

Status
Not open for further replies.

DonManfred

Expert
Licensed User
Please start a new thread in the questionsforum for this issue.
Make sure to upload a sample projekt which shows the issue.
 

DonManfred

Expert
Licensed User
i downloaded the sample, changed the url to yours.
Out of three runs i got
LogCat connected to: 9885e6514556383552
--------- beginning of main
--------- beginning of system
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (downloadservice) Create **
** Service (downloadservice) Start **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
java.net.ProtocolException: unexpected end of stream
Job completed: false
Job completed: true
Job completed: true
but it works at least....
 

DonManfred

Expert
Licensed User
I´ve changed the url to a file on my webspace.
It has just finished the third download of a 101mb file successfully.

Note that network errors can happen due to bad internet connection, other network problems.
 

Gunnar Daehling

Member
Licensed User
I´ve changed the url to a file on my webspace.
It has just finished the third download of a 101mb file successfully.

Note that network errors can happen due to bad internet connection, other network problems.
I think that is not the reason. Too many users of the app report the error. Downloading this file with other apps works reliably. There are other solutions in B4A ?
 

ibra939

Active Member
Licensed User
I´ve changed the url to a file on my webspace.
It has just finished the third download of a 101mb file successfully.

Note that network errors can happen due to bad internet connection, other network problems.
the file note wotking i download it show my this

Please re-upload the file i need to check it
 

Attachments

ibra939

Active Member
Licensed User
I think that is not the reason. Too many users of the app report the error. Downloading this file with other apps works reliably. There are other solutions in B4A ?

I´ve changed the url to a file on my webspace.
It has just finished the third download of a 101mb file successfully.

Note that network errors can happen due to bad internet connection, other network problems.
where the new file URL we need the file to test it ???
 

aidymp

Active Member
Licensed User
The file is ok. The screenshot shows the content of the zip file. The download routine from post #1 does not work reliably.
Maybe I can shed some light on this, I had the same problem! i wrote an app for a client in China, the app was fine running it in the UK, they said the app did not work! download kept failing, so after lots of tests it appeared that most servers seem to stall if only for a few milliseconds, this doesn't cause any problems for most programs or web browsers however this method is seems to fail instantly. I have since switched to an expensive VPS so i get this error very rarely. But it seems to have just resurfaced but only on Apple Mac's I use the same base code for my Android, PC and Mac app, all are fine, but i am getting download failures on Macs'

I did read there was a way to change the timeout, but its not supported with this method, maybe someone can advise if we can change the timeout on this routine?

Thanks

Aidy
 

Martin Larsen

Active Member
Licensed User
Would we be better off using the new resumable subs and the Wait For construction instead of using this library?
 

Erel

Administrator
Staff member
Licensed User
No. You need to use CountingOutputStream as done in this code.
 

aidymp

Active Member
Licensed User
Is this still current? or is there a newer method?

Sorry I'm recreating old projects so may ask this on a few threads, as the forum is getting a little cluttered with old news!

Thanks

Aidy
 

Erel

Administrator
Staff member
Licensed User
Sorry I'm recreating old projects so may ask this on a few threads, as the forum is getting a little cluttered with old news!
Posting in old threads is a good way to add clutter. Please start a new thread in the questions forum.
 

Erel

Administrator
Staff member
Licensed User
Example updated with a new download link, updated targetSdkVersion and clearText attribute which is required as the download link is a non-SSL link.
 
Status
Not open for further replies.
Top