json webservice asynctask android를 사용하여 json 웹 서비스를 호출하는 방법을 알려주시겠습니까? 일부 비동기 작업 background.and 응답을 올 때 해당 팝업을 제거하십시오.어떻게 시스템에 인적 자원 관리를 만들 수 있습니까?
public static String getMethod(String url) {
HttpClient httpclient = new DefaultHttpClient();
HttpResponse response;
String responseString = null;
try {
response = httpclient.execute(new HttpGet(url));
StatusLine statusLine = response.getStatusLine();
if (statusLine.getStatusCode() == HttpStatus.SC_OK) {
ByteArrayOutputStream out = new ByteArrayOutputStream();
response.getEntity().writeTo(out);
out.close();
responseString = out.toString();
} else {
// Closes the connection.
response.getEntity().getContent().close();
throw new IOException(statusLine.getReasonPhrase());
}
} catch (ClientProtocolException e) {
// TODO Handle problems..
} catch (IOException e) {
// TODO Handle problems..
}
return responseString;
}
WebServiceRequestManager wb=new WebServiceRequestManager();
String ss= wb.getMethod("htoard?crsCode=add");
System.out.println("String"+ss);
https://github.com/koush/ion과 같은 것을 사용해보고 싶을 수도 있습니다. –