Android Question You downloaded the apk file by HttpJob This problem occurred:

alfaiz678

Active Member
Licensed User
You downloaded the apk file by HttpJob
This problem occurred:
There was a problem transmitting the package.
You downloaded an audio file and the operation was completed successfully
What is the problem ?
Thank you
B4X:
Sub Button1_Click
    ProgressDialogShow2("Loading .......",False)
    Dim job1 As HttpJob
    job1.Initialize("Job1", Me)
    job1.Download("")
End Sub


Sub JobDone (Job As HttpJob)

    Log("JobName = " & Job.JobName & ", Success = " & Job.Success)
 
    If Job.Success = True Then
        Select Job.JobName
            Case "Job1"
   
                ToastMessageShow("Download Complete", True)
                Dim out As OutputStream = File.OpenOutput(File.DirInternal, "AppUpdateExample.apk", True)

                File.Copy2(Job.GetInputStream, out)
            '    ToastMessageShow("تم تحميل الملف بنجاح",True)
                out.Close
                ProgressDialogHide
                Dim i As Intent
 
                i.Initialize(i.ACTION_VIEW,"file://" & File.Combine(File.DirInternal, "AppUpdateExample.apk"))
                i.SetType("application/vnd.android.package-archive")
 
                StartActivity(i)

        End Select
    Else
        Log("Error: " & Job.ErrorMessage)
        ToastMessageShow("Error: " & Job.ErrorMessage, True)
    End If
    Job.Release
End Sub

And I applied it here
And I got the same problem

https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/#content
 

Attachments

  • ass.zip
    9.4 KB · Views: 169
Last edited:
Top