Hacker News new | ask | show | jobs
by rcoh 4664 days ago
Intents are useful, but could be better. A standard way to hook into the Facebook app is fine for Facebook but what about when the space is more fragmented? Should app authors have to integrate with every document viewer or Mail App?
3 comments

I think the document manager [1] covers this use-case rather well. Any app can register with the OS as being able to open a certain type of file. Then it's just a couple lines to show the user an "Open in..." prompt for a file. This is what Dropbox, Mail, and GDrive do and I think we're going to see a lot more of it in the future.

[1]: https://developer.apple.com/library/ios/documentation/FileMa...

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.

Standard way to hook into the Facebook app is a "Share Intent" which can be picked up by any other social network application; such as Google+, my text messaging app, Google Hangouts, and so many others. Even allowing "copy to clipboard" and "Pin" and whatever else. Almost every Android app creates a Share Intent listener to pull in data.

If there's a document viewer, it'll listen in for the file types it supports when you try to open a file (I think its a VIEW intent). It's all very impressive and very, very useful.

Unless they've changed it, you'll have to use the FaceBook SDK to do anything more than post a URL. FB's intent support is bad.
Ah, yeah. I was talking about iOS in particular. Android intents are pretty sweet -- a couple the missing bits to make them great in my mind are -- App discovery: tell me about apps that can use my content if I don't have any? -- Action curation: What do users think are the best app for this action?