in = new DataInputStream(conn.getInputStream());
String str = "";
while (in.available() > 0) {
str += in.readUTF();
}
in = new DataInputStream(conn.getInputStream());
String str = "";
while (in.available() > 0) {
str2 += Bytes.toString(in.readBytes());
}
I cannot read any response from my php page with two methods above.
in = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8"));
String str2="";
while ( (str += in.readLine()) != null && in.ready()){}
And only this method can works.
Can someone tell me what it is happening either there's the problem of inputstream ,type or charset. Thanks!!