iOS Question HttpRequest

Graeme M itchell

Member
Licensed User
Not sure if this is possible but I want to open a textfile from my server, it is available through a http request http:\\192.168.100.5\database\database.txt

I was thinking of downloading it to a temp location, opening it, reading the data to an array.

Does this seem ok?

So far I have;

Dim hc As HttpClient
hc.Initialize("hc")
Dim req As HttpRequest

req.InitializeGet("http://192.168.100.5/database/database.txt")
hc.Execute(req, 0)

It seems to work but I cant find the downloaded file
 

Graeme M itchell

Member
Licensed User
Hi, i was able to get the file to download, thanks for the help

The file I am downloading is a text file that is currently 5001 rows long and 24 columns wide. I am loading the file i downloaded into a multi-dimensional array, its takes a while and I wanted to add some type of progressbar.

I tried a few things but I couldnt get it to update the bar unless I put in a break and halted the program

B4X:
Sub FillArray       
   partsList = su.LoadCSV(File.DirDocuments, "Database.txt", TAB)
   Dim MyArray (partsList.size,24)As String
   Dim Dummy () As String
   
       For i=0 To partsList.Size -2
           Dummy = partsList.Get (i)
       For j= 0 To 24
           MyArray (i,j)= Dummy(j)
       Next
       Log(i)
   Next

End Sub
 
Top