I did as you said. I used Erel's "LargeFileDownload.zip" example. I added libraries which Erel said. But I received error logs below;
Sub WebView1_OverrideUrl (Url As String) As Boolean
If Url.EndsWith(".pdf") Then
Dim dd As DownloadData
dd.url = Url '<--- download link
dd.EventName = "dd"
dd.Target = Me
CallSubDelayed2(DownloadService, "StartDownload", dd)
Return True
Else If Url.IndexOf("mailto:") > -1 Then
Dim Intent1 As Intent
Intent1.Initialize(Intent1.ACTION_VIEW, Url)
StartActivity(Intent1)
Return True
Else
Return False
End If
End Sub
Sub dd_Complete(Successful As Boolean)
Log("Job completed: " & Successful)
End Sub
Error logs;
Installing file.
PackageAdded: package:app.taksim
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (downloadservice) Create **
** Service (downloadservice) Start **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
app.taksim.main:_dd_complete, [[downloadservice=null, errormessage=, httputils2service=null
, jobname=[url]http://www.taksi-m.com.tr/TAKSIMCustomerUserManuelR2_EN.pdf[/url], main=null, password=
, req=anywheresoftware.b4h.okhttp.OkHttpClientWrapper$OkHttpRequest@427b2a88, starter=null, username=
, tag=[CountingStream=(MyOutputStream) anywheresoftware.b4a.randomaccessfile.CountingStreams$MyOutputStream@428b6c90, Data=[EventName=dd, url=[url]http://www.taksi-m.com.tr/TAKSIMCustomerUserManuelR2_EN.pdf[/url], Target=class app.taksim.main
, IsInitialized=false], Total=58162
, IsInitialized=true], target=class app.taksim.downloadservice, taskid=1
, success=true]]
Error occurred on line: 57 (Main)
java.lang.IllegalArgumentException: argument 1 should have type boolean, got app.taksim.httpjob
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:702)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:336)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.BA$2.run(BA.java:328)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5602)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)