Hi everyone:
I am new to B4I and I am currently developing an app that involves downloading a PDF Document. I am a bit confused as what datatype a downloadable PDF Document is.
My code:
and here is where I started the download:
and here is job done:
Also, how do I initialize the pdfDocument variable since the pdfDocument.initilize()takes a local directory and a file name?
I also found this https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/
but I am unsure how to integrate the changed part into my code. Do I edit the preexisting library file or do I have to start a new one?
I am new to B4I and I am currently developing an app that involves downloading a PDF Document. I am a bit confused as what datatype a downloadable PDF Document is.
My code:
B4X:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Private pg As Page
Private job1, job2, job3 As HttpJob
Private pdfurl = "https://origin2.cdn.componentsource.com/sites/default/files/resources/anywhere-software/534291/b4ibeginnersguidev1_1.pdf"
End Sub
and here is where I started the download:
B4X:
Sub ImageView1_Click
job3.Initialize("Job3", Me)
job3.Download(pdfurl)
End Sub
and here is job done:
B4X:
Sub JobDone (Job As HttpJob)
Dim pdf_data As PDFDocument
If Job.Success = True Then
If Job.JobName = "Job3" Then
pdf_data = Job.get
'the part I am confused about. Job.getwhat?
End If
Else
Log("Error: " & Job.ErrorMessage)
End If
Job.Release
End Sub
I also found this https://www.b4x.com/android/forum/threads/download-huge-files-with-httputils2.30220/
but I am unsure how to integrate the changed part into my code. Do I edit the preexisting library file or do I have to start a new one?