Please tell me how set saving path for downloading file.
For example:
AsyncHttpClient client = new AsyncHttpClient();
String[] allowedTypes = new String[] { "image/png" };
client.get("http://www.example.com/image.png", new BinaryHttpResponseHandler(allowedTypes) {
@Override
public void onSuccess(byte[] imageData) {
// Successfully got a response
}
@Override
public void onFailure(Throwable e, byte[] imageData) {
// Response failed :(
}
});
You need use this byte array with an OutputStream subclass to write the bytes on disc,
This code will write the file on disk, to get the path maintain the File on a variable and use File.getAbsolutePath()