I need to download a large file from server using LoopJ AndroidAsyncHttp in a android app,but got a OOM for the file is to large. I have googled only to find that I need to write my own BinaryHttpResponseHandler and modify sendResponseMessage. But how can I do it? I am new in AsyncHttpClient. Can anybody give me some suggesstion?
Asked
Active
Viewed 671 times
1 Answers
0
Im not sure whether you are asking for this or not . Take a look at http://loopj.com/android-async-http/
AsyncHttpClient client = new AsyncHttpClient();
client.get("http://example.com/file.png", new FileAsyncHttpResponseHandler(/* Context */ this) {
@Override
public void onSuccess(int statusCode, Header[] headers, File response) {
// Do something with the file `response`
}
});

playmaker420
- 1,527
- 4
- 27
- 52