iOS Question B4A to B4I Problem

Discussion in 'iOS Questions' started by AndreasGoering, Mar 20, 2015.

  1. AndreasGoering

    AndreasGoering Member Licensed User

  2. Erel

    Erel Administrator Staff Member Licensed User

    Use HttpUtils2 to download whatever you need to download.
     
  3. AndreasGoering

    AndreasGoering Member Licensed User

    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:
    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: Mar 30, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    Note that there is no good reason to use this code in B4A. Just call Job.GetString. The same is true in B4i.
     
  5. AndreasGoering

    AndreasGoering Member Licensed User

    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: Mar 31, 2015
  6. Brian Robinson

    Brian Robinson Active Member Licensed User

    This code was taken from the tutorial at http://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:
    If File.Exists(File.DirDocuments, "output.xml") = False Then
        
    File.WriteString(File.DirDocuments, "output.xml", job.GetString)
    End If
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice