Reputation: 12059
In an app I'm making my boss wants me to integrate a document viewer, mostly for pdf's but possibly for .docx, .xlsx & .pptx.
But doesn't all android phones come with some kind of document viewer? I'm thinking it would be better to use the existing resources on a phone to view the documents since the main function of this app isn't to be a document viewer.
Does anyone have good experience with this? Which is the better option? Have my own document viewer or rely on whatever is in the phone?
Upvotes: 0
Views: 697
Reputation: 331
Better you use your own document viewver. Because, there is no proper document view for android. Mainly you cannot load pdf file directly in your app. user can view once the pdf file downloaded. we cannot load document which contains more memory. Try some other cloud or online view.
Upvotes: 0
Reputation: 93569
There's nothing that all Android phones come with. Each OEM loads their own selection of software, some of them even replace Google components. But yes, a document viewer is common.
Really it depends. You can actually ask the phone to launch a default viewer for a file format, and it will launch if any is installed. You do this by creating an intent with the VIEW action on the file and MIME type. If one isn't installed, it won't launch. But if you want a library that shows documents in your app, you'll likely either need to pay good money or get the user to download a separate app (which may charge them separately).
As for which way to do it- one way is cheap, easy, but not 100% assured to work. The other is expensive and time consuming, but will always work (or at least will always work if the library you use works on the file). Make your own call.
Upvotes: 1