if i pass the url in my program i m getting the result the same url is
appear in the Textview but i need the answer "Success".
can u pls tel me
with regards,
Raghav.S
getInput = (EditText) this.findViewById(R.id.get_input);
getOutput = (TextView) this.findViewById(R.id.get_output);
getButton = (Button) this.findViewById(R.id.get_button);
getButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
getOutput.setText("");
String st1=getInput.getText().toString();
String output ="http://localhost:8080/Serv1/servlet/Servlet1?name="+st1;
getHttpResponse(output);
if (output != null) getOutput.setText(output);
}
});
};
private String getHttpResponse(String location) {
String result = null;
URL url = null;
try {
url = new URL(location);
} catch (MalformedURLException e) {
}
if (url != null) {
try {
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
BufferedReader in = new BufferedReader(new InputStreamReader(
urlConn.getInputStream()));
String inputLine;
int lineCount = 0;
while ((lineCount < 10) && ((inputLine = in.readLine()) != null)) {
lineCount++;
result += "\n" + inputLine;
}
in.close();
urlConn.disconnect();
}
} else {
}
return b;
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---