I did something very similar to this, but it was a long time ago.
Looking at my source code, I used
HttpClient client = new DefaultHttpClient(); String url = "http://192.168.1.69:8888/sdroidmarshal"; HttpGet getRequest = new HttpGet(url); ResponseHandler<String> responseHandler = new BasicResponseHandler(); String proto = client.execute(getRequest, responseHandler);
I am sure that ResponseHandler is the key to this. My get request just returned me something I needed as a string, which was pretty simple.
In the case of bytearray, you probably want to use an InputStream this way
ResponseHandler<InputStream> responseHandler = new BasicResponseHandler(); InputStream in = client.execute(getRequest, responseHandler);
After that, just handle the InputStream as usual.
A bit of a search engine suggested you also use HttpResponseHandler (), not BasicResponseHandler (), as in my example, I would creak.
The full source code of my work is here , it may be useful for you.
source share