Android Question Need help with unzip progress

Discussion in 'Android Questions' started by Ricardo Bunschoten, May 25, 2015.

  1. Ricardo Bunschoten

    Ricardo Bunschoten Member Licensed User

    This is my code

    Code:
    #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 / 102400) & "KB / " & _
            
    NumberFormat(Total / 102400) & "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 ?
     
  2. NJDude

    NJDude Expert Licensed User

    There's no unzipping progress as far as I know, also, there are events that are triggered when the unzipping is done.
     
    DonManfred and thedesolatesoul like this.
  3. Ricardo Bunschoten

    Ricardo Bunschoten Member Licensed User

    ok but how do i trigger this events.

    I can use a label with text i think when its unzipping and a label with text done when zipping is done but i need to k ow how to trigger that.
     
  4. DonManfred

    DonManfred Expert Licensed User

    Create the right event-subs. they will be called from the library.
    Most probably you can see the events in the lib example.
     
  5. NJDude

    NJDude Expert Licensed User

    In the IDE, type Sub <space bar> <TAB> and you will see a list of views, search for Archiver, select it and you will see all the available events.
     
    wonder and DonManfred like this.
  6. Ricardo Bunschoten

    Ricardo Bunschoten Member Licensed User

    Cool thnx learning more and more :)
     
  7. ilan

    ilan Expert Licensed User

    cool, i didnot knew that... thank you NjDude
     
    wonder likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice