Hacker News new | ask | show | jobs
by krschultz 4664 days ago
You don't have to tie into any particular document viewer at all, in fact the default behavior is exceedingly simple. Call an ACTION_VIEW intent, provide the file argument, and the OS finds the right viewer that is already installed. The app I write doesn't have to know about the difference between .dxf and .xlsx at all, as long as the user has the right viewers. I can't honestly imagine an easier API than that.

In my app, I went one step further and when the user doesn't have an app installed for the given file type, I recommend one, but that isn't a requirement. I keep track of what percentage of view file requests are fulfilled by an already installed app, and it is generally over 95%.

I think you guys should better understand Intents before you trash them (and actually try to replicate them on iOS). Why was the use of Intents so minimal in the Filepicker.io Android library? I replaced that library with a intents and have a much more robust application.