Problem reading the HttpConection response in some devices
Joined: Mar 10, 2008
I am having a strange problem when trying to read the response of an HTTPConnection object. The scenario is this:
1) App in the cellphone connects via HTTP to a webpage 2) The webpage adds some text to the response 3) The app in the cellphone tries to get all the text embedded in the HTTP Response.
If I try the code using emulators or some devices ( like motorola devices ) everything works perfect, but when trying with a live Sony Ericsson W200i I cannot read more than 57 bytes of the response. Here is the sample code:
In the emulator the result is 70 bytes total, 40 bytes in the first read and 30 bytes in the second read. In the real device the result is 70 bytes total too, but 40 bytes in the first read and only 17 bytes in the second read!!! I've tried a dozen ways of reading the response buffer (in a loop, by chunks, in one step all togheter, etc.) and always read only 57 bytes. Any idea???
Joined: Sep 17, 2006
The logic makes sense, if it runs in the simulator but not in the device I think it is a matter for the vendor.
Joined: Jan 11, 2006
To make sure I understand every you tried;
You did try reading from the stream in a while loop, similar to the code below?