我想将我的项目转移到新版本的SDK,但是我遇到了旧方法,即来自数据库的请求。帮助将旧方法转换为新方法。
public void parseJSONData(){:
clearData();
try {
// request data from Category API
HttpURLConnection client = new DefaultHttpClient();
HttpConnectionParams.setConnectionTimeout(client.getParams(), 15000);
HttpConnectionParams.setSoTimeout(client.getParams(), 15000);
HttpUriRequest request = new HttpGet(CategoryAPI);
HttpResponse response = client.execute(request);
InputStream atomInputStream = response.getEntity().getContent();
BufferedReader in = new BufferedReader(new InputStreamReader(atomInputStream));
String line;
String str = "";
while ((line = in.readLine()) != null){
str += line;
}