Android Display .doc File In Webview?
In my app,I have link http://mymobilece.com/api/api_getexammaterials.php?id=28, I want to view in webview ,I try with google document viewer its work fine But i need it without go
Solution 1:
you can use the js for google Doc viever
myScript="<html><iframesrc='http://docs.google.com/gview?
url='http://mymobilece.com/api/api_getexammaterials.php?
id=28'&embedded='true'style='width:600px; height:500px;'frameborder='0'></iframe></html>"
mWebView = (WebView) findViewById(R.id.webview);
mWebView.getSettings().setJavaScriptEnabled(true);
mWebView.loadData(myscript,"text/html", "UTF-8");
you can use myscript as string variable and use this javascript code(please make sure to remove double quite if above code) and load in webview
- You can change the url - width- height variables according to your scripting.
Post a Comment for "Android Display .doc File In Webview?"