Samsung and ASUS devices trouble with downloading OR extract with Archiver/HTTPJOB

jdiperla

Member
Licensed User
Longtime User
Truth is, I am not sure where the problem is exactly. I want to say that its with the Archiver. But I get the error message before the app runs archiver. This seems to be an issue specific to Galaxy S 3's and also ASUS Galaxy 4/7/10/tf201.

I duplicated it on my Nexus 7 and on my TF201. However, I own a Galaxy s II and noticed that I have not had any trouble with that. But I am getting reports from my users that the S III is not downloading the items properly. The libraries I am using are Archiver and also HTTPUTILS2. Here is the code I have:

When the download completes, here is where the code goes:

B4X:
Sub JobDone(Job As HttpJob)

   Select Job.JobName
      Case "gFileDL"
         
         
   If GJob.Success = False Then
         ToastMessageShow("Error downloading the file.", True)
         notification1.Number = 1
    notification1.SetInfo("Downloading Completed: UNSUCCESSFUL", "The Download failed", Main)
    notification1.AutoCancel = True
 notification1.OnGoingEvent = False
    notification1.Notify(1)
JobStatus = "STATUS_DONE"
         
   End If
   If GJob.Success = True Then
   notification1.Number = 1
   notification1.AutoCancel = True
 notification1.OnGoingEvent = False
    notification1.SetInfo("Downloading Completed: SUCCESSFULLY", "Your file is being installed.", Main)
    notification1.Notify(1)
   startinstall(UrlTarget, URLFile)
   
   End If

   End Select
   
   Job.Release
   
End Sub

It seems for every file it downloads it has issues with it and gives the message that the file did not download successfully. However, despite that, it seems to still perform the "Startinstall(URL, File)" command as if it were successful. The funny thing is, I watched as a large file was being downloaded. I opened up the file manager and saw that the file was downloading and increasing in size. However, when it does the StartInstall, it says it completed successfully, however, it really didn't. Here is the code for Startinstall:

B4X:
Sub startinstall(targetdir As String, targetfile As String)
JobStatus = "STATUS_NONE"
   
   
   
   ToastMessageShow("Installing your file", True)
   
   Dim arc As Archiver
Dim m As Map
Try


 arc.aSyncUnZip(GJob.GetInputDir, GJob.GetInputfile, targetdir, "arc")

Catch
    Log(LastException.Message)
   ToastMessageShow("There was a problem installing the file", True)
End Try
End Sub

Not sure whats going on. From the outset, to summarize, it seems that the file is downloading, but once its done, the file disappears and then I get the error that it did not download successfully. Yet, the app continues as if it did, but at the end of it all, it didn't install the file. I hope this makes sense. I am not sure why its doing this on some devices and on others no.

Just for completeness sake:
My Nexus 7 runs Android 4.2.2 JB rooted
My Galaxy SII is running Cyanogen Mod 10 with Android 4.2.1 JB
My TF 201 is running ICS, not rooted.

My Galaxy S II Works perfectly fine, the other two however have the issues and anyone with an SIII also has the issue. Any advice, thoughts, suggestions, help?????? Thanks in advance.

EDIT: Also GJob is Dimmed as HTTPJOB just in case you were wondering. These were added/modified by me (I believe...?) so that it would work the way I needed it to:

B4X:
Sub GetInputStream As InputStream
   Dim In As InputStream
   In = File.OpenInput(HttpUtils2Service.TempFolder, taskId)
   Return In
End Sub
Sub GetInputDir As String
Dim In As String
In = HttpUtils2Service.TempFolder
Return In
End Sub
Sub GetInputfile As String
Return taskId
End Sub
 
Last edited:

jdiperla

Member
Licensed User
Longtime User
OK. I figured it out. The Tempfolder in httputils2 had to be changed to goto file.dirinternalcache for those devices, otherwise it wouldn't work right. I dont know why it does that, but that is the situation. For Samsung Galaxy SIII, Nexus 7 and Asus TF201, thats what needs to be done.
 
Upvote 0
Top