public List<News> getLastNews() {
String path="http://20.0.1.1:8080/TestAndoid/ListServlet";
HttpURLConnection con=null;
try {
URL url = new URL(path);
con = (HttpURLConnection)url.openConnection();
con.setConnectTimeout(5000);
con.setRequestMethod("GET");
//con.connect();
//int i = con.getResponseCode();
if(con.getResponseCode()==200){
InputStream in = con.getInputStream();
return parseJson(in);
}
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}