i want to sent very large data from Server to client, the server is tomcat Java and the client is android application , i am working with servlets
server servlet
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException,
IOException {
ServletOutputStream out = response.getOutputStream();
CellDatabase cDB = new CellDatabase();
String[] cells = cDB.getAllCells();
for (int i = 0; i < cells.length; i++)
out.write(cells[i].getBytes());
out.flush();
}
my question is : how can i got that data on android , because i didn't find something like
response.getOutputStream();
android
HttpClient client = new DefaultHttpClient();
website = new URI(
"http://10.0.2.2:8080/LocalizedBasedComptitionServer/GetCells");
HttpPost request = new HttpPost();
request.setURI(website);
HttpResponse response = client.execute(request);