In my android application i’m signing up a user with username and password, if done correctly it returns value “1” if not then “0” by calling a URL with a username and password as parameters and the result 0 or 1 shows in html body.
my signup is doing perfectly but the html result 0 or 1 is not showing, instead of showing
java.io.BufferedInputStream@23888f88
I’ve written a code to read the html data
public String getDataFromURL(String urlString) throws Exception {
String response="";
URL url = new URL(urlString);
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
try {
InputStream in = new BufferedInputStream(urlConnection.getInputStream());
//readStream(in);
response = in.toString();
}
finally {
urlConnection.disconnect();
}
return response;
}
Now what should i do to get the html body text ?
Thanks
You could try this. The String str will contain your response.
You can put it into a function etc
and just call
Hope it helps