-1

i want my app to directly read data from the pdf and word files i have. is it possible to display it on the screen for user to read it?? If it needs to act as a local database then how can i use that pdf file as database for that app??

  • Possible duplicate of [Display PDF within app on Android?](http://stackoverflow.com/questions/2456344/display-pdf-within-app-on-android) – just_deko Apr 08 '16 at 20:40

2 Answers2

1

Do you mean to extract the information (text) from the pdf? If you just need to extract the text from a pdf file, you could use this code, then you just need it to convert into any displayable form you like, be it a cardview or listview, or whatever you want.

I do not understand the part with "read data from word files"... if you mean by "Reading" data extracting information, then you just can convert the word file into a text file once again (or just read it like that), and then read the data there. here is a good thread about it.

If this answer is not enough for you, you need to concretize it.

EDIT: If you mean by "read pdf files" displaying them on the screen, there are tons of various libraries, such as joanzapatas pdfview, plugpdf or the webview, see the other answers for that.

Community
  • 1
  • 1
just_deko
  • 1,024
  • 1
  • 14
  • 29
1

You can display PDF files inside your app in a WebView using PDF.js. (I don't know about anything similar for Word files.)

You can also pass the documents to other applications that will display it by using a content provider. If the files will be stored in the application's data storage (file system, not a database), you can use FileProvider:

startActivity(new Intent(Intent.ACTION_VIEW,
                         FileProvider.getUriForFile(context, "com.example.files", file))
                  .setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION));
StenSoft
  • 9,369
  • 25
  • 30