Mar 21, 2011 Replies: 16 This update changes the way that bytes arrays are managed in HttpRequest.InitializePost2. This change allows HttpClient to retry and resend the data in case of IO errors. It makes POST calls more stable. Some errors are now printed to the unfiltered log and give more information about the error. Edit: The Response object which is passed to HttpClient_ResponseError is not consumed automatically. It allows you to read the message sent from the server. However it also means that you are responsible to call Response.Release eventually. Typical code should look like: Code: Copy Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int) Log("Error: " & Reason & ", StatusCode: " & StatusCode) If Response <> Null Then Log(Response.GetString("UTF8")) Response.Release End If End Sub Installation instructions: - Unzip the attached file. - Copy both files to the internal libraries folder: C:\Program Files\Anywhere Software\Basic4android\Libraries Attachments HTTP.zip HTTP.zip 15.8 KB · Views: 1,361 Click to expand...
This update changes the way that bytes arrays are managed in HttpRequest.InitializePost2. This change allows HttpClient to retry and resend the data in case of IO errors. It makes POST calls more stable. Some errors are now printed to the unfiltered log and give more information about the error. Edit: The Response object which is passed to HttpClient_ResponseError is not consumed automatically. It allows you to read the message sent from the server. However it also means that you are responsible to call Response.Release eventually. Typical code should look like: Code: Copy Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int) Log("Error: " & Reason & ", StatusCode: " & StatusCode) If Response <> Null Then Log(Response.GetString("UTF8")) Response.Release End If End Sub Installation instructions: - Unzip the attached file. - Copy both files to the internal libraries folder: C:\Program Files\Anywhere Software\Basic4android\Libraries
Erel B4X founder Staff member Licensed User Longtime User Apr 22, 2011 #2 A new version (1.10) was uploaded to the first post. It fixes an issue related to the Response object not equals Null although it should be Null. This will cause a NullPointerException to be thrown when the string is retrieved. There is also a new example of how to download a web page as a string in the manual: Basic4android - HTTP
A new version (1.10) was uploaded to the first post. It fixes an issue related to the Response object not equals Null although it should be Null. This will cause a NullPointerException to be thrown when the string is retrieved. There is also a new example of how to download a web page as a string in the manual: Basic4android - HTTP
B batchfile New Member Licensed User Longtime User Jun 16, 2011 #3 Non-Async Downloads Is there any way I can just do: Dim a as string a = HttpClient.GetString("www.google.com") ? It's just easier sometimes. Also, I've noticed that it will crash if you queue more than 20 work items. I did a quick loop to download some images and it gave me some error about a pool or queue, something like that. I don't have the exact error right now. If there was a ConcurrentTasks property then we could just set one number and internally it would handle it a little nicer so we could just queue up all we want. In my case i'd queue up and download about 50 thumbnail sizes images about 128x128 each. Each time an image is downloaded I add a listview item with the image and some text.
Non-Async Downloads Is there any way I can just do: Dim a as string a = HttpClient.GetString("www.google.com") ? It's just easier sometimes. Also, I've noticed that it will crash if you queue more than 20 work items. I did a quick loop to download some images and it gave me some error about a pool or queue, something like that. I don't have the exact error right now. If there was a ConcurrentTasks property then we could just set one number and internally it would handle it a little nicer so we could just queue up all we want. In my case i'd queue up and download about 50 thumbnail sizes images about 128x128 each. Each time an image is downloaded I add a listview item with the image and some text.
B batchfile New Member Licensed User Longtime User Jun 16, 2011 #4 This is what I would do in .net: Dim result = My.Computer.Network.DownloadFile("SomeURL")
Erel B4X founder Staff member Licensed User Longtime User Jun 16, 2011 #5 You should use HttpUtils. It takes care of such problems. For some reason you appear as an unlicensed user in the forum. Please contact [email protected] in order to fix it.
You should use HttpUtils. It takes care of such problems. For some reason you appear as an unlicensed user in the forum. Please contact [email protected] in order to fix it.
P petri2000 Member Licensed User Longtime User Aug 23, 2011 #6 Java error adding HTTPUtils Service module I have a simple app that is collecting user data and now I am trying to submit the data to a webservice. But once I add the modules HttpUtils & HttpUtilsService (Version 1.02) and try to compile (without even using anything from these modules) I get the following error (See below). Any Ideas? The HTTP Utils sample works fine. In the project I also have reference to the following libraries: HTTP 1.10, Phone 1.37, SQL 1.02, XMLSax 1.0, Animation 1.02 and Core 1.45 Any help appriciated. :sign0085: Compiling code. 0.05 Generating R file. 0.00 Compiling generated Java code. Error javac 1.6.0_21 src\com\animation\test\httputilsservice.java:54: cannot find symbol symbol : class IntentWrapper location: package anywheresoftware.b4a.objects anywheresoftware.b4a.objects.IntentWrapper iw = new anywheresoftware.b4a.objects.IntentWrapper(); ^ 1 error Some Additiona info: after trying to figure out what was wrong and tying to run the samples again i realised that the HTTPUtils samples do not work anymore!!!! Is this because I managed to break some library or? The same error message occurs as above. Last edited: Aug 23, 2011
Java error adding HTTPUtils Service module I have a simple app that is collecting user data and now I am trying to submit the data to a webservice. But once I add the modules HttpUtils & HttpUtilsService (Version 1.02) and try to compile (without even using anything from these modules) I get the following error (See below). Any Ideas? The HTTP Utils sample works fine. In the project I also have reference to the following libraries: HTTP 1.10, Phone 1.37, SQL 1.02, XMLSax 1.0, Animation 1.02 and Core 1.45 Any help appriciated. :sign0085: Compiling code. 0.05 Generating R file. 0.00 Compiling generated Java code. Error javac 1.6.0_21 src\com\animation\test\httputilsservice.java:54: cannot find symbol symbol : class IntentWrapper location: package anywheresoftware.b4a.objects anywheresoftware.b4a.objects.IntentWrapper iw = new anywheresoftware.b4a.objects.IntentWrapper(); ^ 1 error Some Additiona info: after trying to figure out what was wrong and tying to run the samples again i realised that the HTTPUtils samples do not work anymore!!!! Is this because I managed to break some library or? The same error message occurs as above.
Erel B4X founder Staff member Licensed User Longtime User Aug 23, 2011 #7 Which version of Basic4android are you using?
P petri2000 Member Licensed User Longtime User Aug 23, 2011 #8 Java error adding HTTPUtils Service module I am using 1.60, registered version (of course) I've Restarted (in case of any Windows issues, have win7 ultimate), I also uninstalled and reinstalled the Android SDK. Cheers, Petri
Java error adding HTTPUtils Service module I am using 1.60, registered version (of course) I've Restarted (in case of any Windows issues, have win7 ultimate), I also uninstalled and reinstalled the Android SDK. Cheers, Petri
Erel B4X founder Staff member Licensed User Longtime User Aug 23, 2011 #9 You are using an old version of Phone library which is not compatible with B4A v1.6. Make sure that there is no copy of Phone library in the additional libraries folder.
You are using an old version of Phone library which is not compatible with B4A v1.6. Make sure that there is no copy of Phone library in the additional libraries folder.
P petri2000 Member Licensed User Longtime User Aug 24, 2011 #10 Erel said: You are using an old version of Phone library which is not compatible with B4A v1.6. Make sure that there is no copy of Phone library in the additional libraries folder. Click to expand... Thanks for the tip. I updated the Phone Library to 1.42 and made sure that there are no dublicates in the additional Library folder. However the same error remains when trying to run any app with reference to the httputils modules.
Erel said: You are using an old version of Phone library which is not compatible with B4A v1.6. Make sure that there is no copy of Phone library in the additional libraries folder. Click to expand... Thanks for the tip. I updated the Phone Library to 1.42 and made sure that there are no dublicates in the additional Library folder. However the same error remains when trying to run any app with reference to the httputils modules.
Erel B4X founder Staff member Licensed User Longtime User Aug 24, 2011 #11 The version of the phone library should be 1.55. Reinstall Basic4android v1.6. It should include the updated library.
The version of the phone library should be 1.55. Reinstall Basic4android v1.6. It should include the updated library.
P petri2000 Member Licensed User Longtime User Aug 24, 2011 #12 Erel said: The version of the phone library should be 1.55. Reinstall Basic4android v1.6. It should include the updated library. Click to expand... Thanks for the prompt response Erel... I followed your instructions uninstalled (and made sure the old libraries folders were deleted) and have now the updated version of the 1.55. Unfortunetly, exactly the same error occurs as previously. :BangHead: I am really hitting the wall here...
Erel said: The version of the phone library should be 1.55. Reinstall Basic4android v1.6. It should include the updated library. Click to expand... Thanks for the prompt response Erel... I followed your instructions uninstalled (and made sure the old libraries folders were deleted) and have now the updated version of the 1.55. Unfortunetly, exactly the same error occurs as previously. :BangHead: I am really hitting the wall here...
P petri2000 Member Licensed User Longtime User Aug 24, 2011 #13 I basically given up and are creating the B4A in an virtual environment to start from scratch. After installing and trying to compile... I get the following message. Compiling code. 0.14 Generating R file. 0.00 Compiling generated Java code. Error javac 1.7.0 javac: target release 1.5 conflicts with default source release 1.7 I assume from the error message that Only 1.6 of the JDK is supported. Correct?
I basically given up and are creating the B4A in an virtual environment to start from scratch. After installing and trying to compile... I get the following message. Compiling code. 0.14 Generating R file. 0.00 Compiling generated Java code. Error javac 1.7.0 javac: target release 1.5 conflicts with default source release 1.7 I assume from the error message that Only 1.6 of the JDK is supported. Correct?
agraham Expert Licensed User Longtime User Aug 24, 2011 #14 petri2000 said: I assume from the error message that Only 1.6 of the JDK is supported. Correct? Click to expand... Correct! The Android SDK does not currently work with Java 1.7. There is a link to the correct Java 1.6 here.
petri2000 said: I assume from the error message that Only 1.6 of the JDK is supported. Correct? Click to expand... Correct! The Android SDK does not currently work with Java 1.7. There is a link to the correct Java 1.6 here.
P petri2000 Member Licensed User Longtime User Aug 24, 2011 #15 OK, I think I solved the issue! To make it easier for other that might have a similar issues. How I solved this... was the following steps.... 1) I went in the IDE to the tools -> Configure paths -> and made the additional libraries option blank. 2) Run the samples -> all worked! 3) I went through and deleted any dublicates in the optional library path.. Voila! It worked! Leasons learnt! Do not dublicate libraries in the default library path and in the additional libray folder. Maybe this could be a check implemented in a future versions of the IDE to check for dublicate versions of libs (as updated libs seems to be installed with new released of the IDE). Cheers, Petri
OK, I think I solved the issue! To make it easier for other that might have a similar issues. How I solved this... was the following steps.... 1) I went in the IDE to the tools -> Configure paths -> and made the additional libraries option blank. 2) Run the samples -> all worked! 3) I went through and deleted any dublicates in the optional library path.. Voila! It worked! Leasons learnt! Do not dublicate libraries in the default library path and in the additional libray folder. Maybe this could be a check implemented in a future versions of the IDE to check for dublicate versions of libs (as updated libs seems to be installed with new released of the IDE). Cheers, Petri
KY Leng Active Member Licensed User Longtime User Dec 18, 2014 #16 Hi, Do anyone here know how to use Http Post to send a request with the following procedure: POST /glm/mmap HTTP/1.1 HOST: google.com Content-Type: application/binary Content-Length: 82 Connection: close And the relevant string consists of 82 characters. I know how to use Http with Url, but with these kind of requirement/procedure, I don't know. Looking forward to hearing from you all soon,
Hi, Do anyone here know how to use Http Post to send a request with the following procedure: POST /glm/mmap HTTP/1.1 HOST: google.com Content-Type: application/binary Content-Length: 82 Connection: close And the relevant string consists of 82 characters. I know how to use Http with Url, but with these kind of requirement/procedure, I don't know. Looking forward to hearing from you all soon,
Erel B4X founder Staff member Licensed User Longtime User Dec 18, 2014 #17 Please start a new thread for this question.