iOS Question B4A to B4I Problem

Ah thanks that helps a lot.
Now i have changed the Project to HttpUtils.

The next problem is the "TextReader"
I found a post that “Textreader” is not available B4I and I should use File.ReadString2 or File.WriteString2.
But I need help in this case:


Code: Copy
  If Job.Success Then
     Dim myTextReader As TextReader
     myTextReader.Initialize(Job.GetInputStream)
     Dim Xml As String = myTextReader.ReadAll
     Log(Xml)
     myTextReader.Close

I’ve tried a few solutions but none of them works fine.
 
Last edited:
Upvote 0
Note that there is no good reason to use this code in B4A. Just call Job.GetString. The same is true in B4i.

Ah great, thanks. That works fine.

Now I would like to generate the request to a XML file.
Is there are a Soultion or a Tutorial available?
 
Last edited:
Upvote 0
This code was taken from the tutorial at https://www.b4x.com/android/forum/threads/files-and-folders.46137/#content and adapted to suit what I think you want.

When you say "generate the request to a XML file", do you mean write the response of the request to an xml file?

Code: Copy
If File.Exists(File.DirDocuments, "output.xml") = False Then
    File.WriteString(File.DirDocuments, "output.xml", job.GetString)
End If
 
Upvote 0
Back
Top