This is my code
It download a zipfile and unpacks it to a folder
This works but now i want to see the unpack progress ?
And if the file fails or is done with unpacking i get a message done or error
I am struggling with this ?
B4X:
#Region Project Attributes
#ApplicationLabel: Veolo 4K Kodi Skin installer
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
Private link1 As String = "https://copy.com/iPuNeMRRsGiVcwk4/1Channel-master.zip"
End Sub
Sub Globals
Dim ProgressBar1 As ProgressBar
Dim Label1 As Label
Dim btnDownload As Button
Dim btnCancel As Button
Dim Arc As Archiver
End Sub
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("1")
End Sub
Sub btnDownload_Click
Dim dd As DownloadData
dd.url = link1
dd.EventName = "dd"
dd.Target = Me
CallSubDelayed2(DownloadService, "StartDownload", dd)
End Sub
Sub dd_Progress(Progress As Long, Total As Long)
ProgressBar1.Progress = Progress / Total * 100
Label1.Text = NumberFormat(Progress / 1024, 0, 0) & "KB / " & _
NumberFormat(Total / 1024, 0, 0) & "KB"
End Sub
Sub dd_Complete(Job As HttpJob)
Log("Job completed: " & Job.Success)
Dim o As OutputStream
o = File.OpenOutput(File.dirrootExternal, "Download/Veolo4K.zip", False)
File.Copy2(Job.GetInputStream, o)
o.Close
Arc.aSyncUnZip(File.DirRootExternal, "/Download/Veolo4K.zip" , File.DirRootExternal & "/Android/data/org.xbmc.kodi/files/.kodi/", "arc")
Job.Release
End Sub
Sub btnCancel_Click
CallSubDelayed2(DownloadService, "CancelDownload", link1)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
It download a zipfile and unpacks it to a folder
This works but now i want to see the unpack progress ?
And if the file fails or is done with unpacking i get a message done or error
I am struggling with this ?