1

i am working on Document fatch app and i need to show .doc,.docx,xls files from my external storage to my app as i able to view pdf using pdf viewer but not getting how to show these files.

user
  • 471
  • 2
  • 16
  • 31
  • You can try opening files inside Google docs viewer in WebView. Check http://stackoverflow.com/a/28023795/1306419 – Shobhit Puri Apr 23 '15 at 20:05
  • opening fine inside google docs redirecting to outside the app.i have file in external storage and just wand to display in as i doing with pdf – user Apr 23 '15 at 20:30
  • You've to override `shouldOverrideUrlLoading` and return true to tell it that the app will handle it and you don't want it to redirect to the broiwser. See: http://stackoverflow.com/questions/7263367/webview-clicks-opens-mobile-browser – Shobhit Puri Apr 23 '15 at 21:18

1 Answers1

0

There is an android branch of Java library docx4j, you can use it. Another option is using Webview, set:

webview.getSettings().setPluginsEnabled(true);
webView.getSettings().setJavaScriptEnabled(true); 

and then pass link of your document to webview (it can also be local link). I am not sure that webview solution will work on all versions of Android, so docx4j is more generic solution.

Alon Zilberman
  • 2,120
  • 1
  • 16
  • 16