B4A Library Downloading with resume

hi this library helps you download a file with resume support
B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
Dim dm As Downloading

End Sub
Sub Service_Create
dm.initialize("test")
End Sub

Sub Service_Start (StartingIntent As Intent)

dm.Download("http://xxxxx",File.DirRootExternal&"/test.zip",0)

End Sub

Sub Stop
dm.stop
End Sub

Sub test_DownloadStatus (Status As Long , Total As Long)

End Sub

Sub test_DownloadFinish (Success As Boolean)

End Sub

the third number in the method Download is start download from byte the file
NOTE:
this lib writes to append files so if you want to restart a download you must delete the old file before start downlod
this library supports only 1 download
add this line to your manifest:
B4X:
AddApplicationText(<service android:name="anywheresoftware.b4a.downloadmanager.DownloadService"/>)
 

Attachments

  • Downloading.zip
    5 KB · Views: 308
Last edited:

LucaMs

Expert
Licensed User
Longtime User
Take your credit card, I need an icecream ;)
Here is the example attached


lemonicecream.jpg
 

ArminKH

Well-Known Member
This is your favorite? :D

@mohsen nasrabady
Please explain more detailes about resuming paused download process
Thank u
-----------------------Local language
Agha bi zahmat ye sample khob bezar kheilia lazem daran
Masalan malom ni_ chejori bayad az jayi k download ghablan pause shode resume she
Lotfan age momkene ye tozihi bd
------------------------
 
Last edited:

lemonisdead

Well-Known Member
Licensed User
Longtime User
@arminkh: resuming is done using the Position (take a look at the example I have published two messages above)
 

enricora

Member
Licensed User
Longtime User
Thank you at all, i suggest this library for solve problem with download from https , where other methodologies fail this library succeeds.

Thanks again
 
Top