I want to intercept a request to blobservice on my Android application
to url looks like that:
http://foo.appspot.com/simpleams/blobservice?blob-key=AMIfv94NAAoxn1oi_ySWYSiNF3MforFVI6SvDi_NeF0rjNr_QW
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if(url.contains("blobservice")) {
return getAppWebResourceResponseFromBlobstore(view, url);
} else {
return super.shouldInterceptRequest(view, url);
}
}
private WebResourceResponse getAppWebResourceResponseFromBlobstore(WebView view, String url) {
try {
// TODO:
return file from local data or download it from
blob service, save it and return it...
} catch (IOException e) {
return null;
}
}
How can i make the request to the server and save the file locally?
I found the solution by my self and want to share it with you: