A AndreasGoering Member Licensed User Longtime User Mar 20, 2015 #1 Hi, i've treid to change the code from this Thread : https://www.b4x.com/android/forum/threads/webservice.26996/#post-156454 into B4i but theres is a problem with the myhttprequest. It seems that doest work with B4i.
Hi, i've treid to change the code from this Thread : https://www.b4x.com/android/forum/threads/webservice.26996/#post-156454 into B4i but theres is a problem with the myhttprequest. It seems that doest work with B4i.
Erel B4X founder Staff member Licensed User Longtime User Mar 22, 2015 #2 Use HttpUtils2 to download whatever you need to download. Upvote 0
A AndreasGoering Member Licensed User Longtime User Mar 30, 2015 #3 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: Mar 30, 2015 Upvote 0
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.
Erel B4X founder Staff member Licensed User Longtime User Mar 30, 2015 #4 Note that there is no good reason to use this code in B4A. Just call Job.GetString. The same is true in B4i. 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.
A AndreasGoering Member Licensed User Longtime User Mar 31, 2015 #5 Erel said: Note that there is no good reason to use this code in B4A. Just call Job.GetString. The same is true in B4i. Click to expand... 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 Upvote 0
Erel said: Note that there is no good reason to use this code in B4A. Just call Job.GetString. The same is true in B4i. Click to expand... 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?
B Brian Robinson Active Member Licensed User Longtime User Mar 31, 2015 #6 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
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