Dim ur As String = ("http://192.168.1.4/MyFile/")
Sub Activity_Create(FirstTime As Boolean)
Activity.LoadLayout("Layout")
advWV.CookiesEnabled = True
advWV.GeolocationEnabled = True
advWV.loadUrl(ur)
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Activity_KeyPress (KeyCode As Int) As Boolean 'Return True to consume the event
If KeyCode=KeyCodes.KEYCODE_BACK Then
advWV.onBackPressed
'Return True
End If
Return True
End Sub
Sub AdvWv_onDownloadRequested(url As String, suggestedFilename As String, mimeType As String, contentLength As Long, contentDisposition As String, userAgent As String)
suggestedFilename0=suggestedFilename
' 'Send a GET request
downloadurl = url
Dim job As HttpJob
job.Initialize("Job", Me)
job.Download(downloadurl)
ProgressDialogShow("جاري تنزيل الملف")
End Sub
Sub JobDone (job As HttpJob)
If job.Success Then
Dim out As OutputStream = File.OpenOutput(File.Combine(File.DirRootExternal, "Download"), suggestedFilename0, True)
File.Copy2(job.GetInputStream, out)
out.Close '<------ very important
ToastMessageShow("تم تنزيل الملف",True)
'Log( job.GetString2("UTF-8"))
Else
'Log("Error: " & job.ErrorMessage)
End If
job.Release
ProgressDialogHide
End Sub