Want to download textfile from protected site
and show the text file directly in ListView1
without saving it first to file.
If this is not possible then suggestion to getAsync put ooutput in list or listview
the following give error wwReq
target host must not be null when button1_Click is executed
Help is needed
grCor
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
Dim ListView1 As ListView
Dim wwwReq As HttpRequest
Dim wwwCli As HttpClient
Dim wwwRes As HttpResponse
End Sub
Sub Activity_Create(FirstTime As Boolean)
activity.LoadLayout("main")
ListView1.AddSingleLine("test")
' Listview1.Initialize("ListView")
wwwCli.Initialize("Client")
wwwCli.SetCredentials("login","name")
wwwReq.InitializeGet("www.10eurosoftware.com/download/Leren.txt")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub Button1_Click
If wwwCli.Execute(wwwReq,10) = False Then
ToastMessageShow("wwwCli failed",True)
End If
' want to get Leren.txt into ListView1, not first to write to file
?????
' If wwwRes.GetAsynchronously("GetFile","Leren.txt",True,10) = False Then
' ToastMessageShow("wwwRes failed",True)
'
' End If
End Sub
Sub Client_ResponseError (Reason As String, StatusCode As Int, TaskId As Int)
ToastMessageShow(reason,True)
End Sub
Sub Client_ResponseSuccess (Response As HttpResponse, TaskId As Int)
ToastMessageShow(response,True)
End Sub
Sub ListView1_ItemClick (Position As Int, Value As Object)
ToastMessageShow(value,True)
End Sub