In my app i have
URL:: http://mymobilece.com/api/api_getexammaterials.php?id=27
Its a file how to show in webview? but not with Google document viewer.
webView.loadUrl("http://mymobilece.com/api/api_getexammaterials.php?id=27");
if it's a local file, then put it in your assets folder and do webView.loadUrl("file:///android_asset/myFile.html");
Related
I am downloading a pdf file in webview(flutter_inappwebview),but after downloading i see .bin extension file,The pdf downloading page is locked behind login,so i tried including headers like cookies,userAgents
please solve the my question ?
Govt Website Restrict Download of pdf ,So i finally generated own pdf
Can anyone tell me how can i read a pdf file directly into my android app without downloading it from firebase?
I have uploaded a pdf file in firebase storage and now i want to read that file in my app without downloading it.
It's very simple
Use a web view in your layout and load the firebase pdf file url into your webview.
I wanted to open a file without downloading it so i used window.open in InAppBrowser and it works fine in ios... But i am not able to open a pdf file this way on android.
I was able to open a pdf file using google doc by prefixing like my url:
https://docs.google.com/gview?embedded=true&url=<my_url>
Now its opening pdf files, but files with images (.png) or text (.txt) cannot be opened this way, because they will be shown as html files.
So, when i get a pdf file on an android device it should check if the last three characters are matching (pdf) and in that case add a prefix to open the pdf file. All other files should work fine.
How about:
String url = "my_pdf.pdf";
if(url.endsWith(".pdf")){
url = "https://docs.google.com/gview?embedded=true&url=" + url;
}
I want to save a .rtf Rich text file with my app as offline help. when the user clicks for offline help, the app will show this text file. I don't want to use pdf help file because it wont be accessible on phone with no pdf viewer.
I would like to use html offline page stored in Assets folder if that is a better approach than the RTF file.
I have seen this Loading existing .html file with android WebView just looking for the .rtf file answer now
i have a html embeds a swf file
i write this to load the html file by webview :
mywebview.loadUrl("file:///android_asset/myweb.html");
now i have a question , i wanna let the html embed a swf file , which also in the
eclipse project assets directory.
could anyone tell me what path should i set? file:///android_asset/myswf.swf??
You should use a relative path. If your HTML and SWF file resides in the same folder, use the SWF filename directly. (i.e. myswf.swf).