I have a problem with google doc viewer for display xls file get from my server.
Currently when i try to display my xls file get from my server in my android app with a webview, i have a grey page with no preview available
(I can download the xls from my server with the url).
Sorry, I could not share link but It's like xxxx.com/123/DownloadExcel_GET?paraOne=%s¶Two=%s¶Three=%s.
But when i try with xls exemple file in internet like http://lecompagnon.info/demos/demoxl3.xls , i don't have this problem. The xls is display succesfully.
Same it's working if i try with a googleDrive url like "drive.google.com/file/t/myfile/view?usp=sharing".
The only difference with the exemple file in internet and my file from my server, is the time to start the download. With the exemple file is instant, but with my xls i have to wait more than 10sec to start the download.
I think google doc viewer return no preview available, because for him 10sec to get the file is too long and he return a time out. But it's a supposition...
I found nothing about this problem, only this topic Google Document Viewer shows "No Preview Available" .
Here is my code :
String urlgoogle = "https://docs.google.com/gview?embedded=true&url=";
String completeURL = urlgoogle + query;
Log.i("completeURL", completeURL);
wv.getSettings().setJavaScriptEnabled(true);
wv.loadUrl(completeURL);
//wv.loadUrl("https://docs.google.com/gview?embedded=true&url=" + "http://lecompagnon.info/demos/demoxl3.xls"); working
wv.setWebViewClient(new WebViewClient() {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
view.loadUrl(url);
return false;
}
});
edit I add more information. The grey page with no preview available not always showing, sometimes my xls file is display successfully the first time.
If i have the grey page, i can refresh, and after one or two refresh, the file is display. The refresh just call again the url in the webview
The file is dynamically create and generated from the serveur, this is why for download or get the file i must wait 10 sec.
Do Google doc viewer have a timeout if the time to get the file to display is too long ?