I have a weird issue. I receive the following error that causes a force-close:
org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0:
Per InputStream javadoc the method will block until the data is available or the EOF is encountered. So, the other side of Socket needs to close it - then the inStream.read() call will return.
If you use BufferedReader , you can read in a line-by-line manner. The readLine() method will return as soon as a line from HTTP response is read.