On Sun, Sep 11, 2011 at 12:26 PM, Rick Byers
<rby...@google.com> wrote:
Hey Paul,I was just poking around at your examples to better understand how you invision share and pick intents being used (funny actually - I was poking on github and then cloned your repo just after you moved everything around for ruby, took me a minute to realize what happened <grin>). By the way, the "Contributing" link on your site doesn't work (there's no contributing section on the main page).
I was initially confused reading your
description of the Share intent - wondering why the data format for image/* is a URI or URI list (rather than just the image data in an ArrayBuffer or binary string or something). I see from your code that you use data URIs - so now I understand why the spec is written that way. But why use URIs at all instead of just sending the raw image data? I'm thinking of scenarios like sharing videos where the content is quite large. Are data URIs really appropriate for that? Even storing the entire data directly in the intent object worries me a bit, but I figure the implementation could always chunk the transfer and perhaps some progress indication could be added to the API. But if the Share intent is spec'd to take only URIs (and lists of URIs) then the implementation is more constrained, right? Or are you thinking of some other URI scheme which could still allow cross-origin communication (I'm not aware of any existing mechanism other than data URIs myself).
URI's give us the ability to pass data by value (as data URI's) or as a reference (a plain old url). If the app recieves a url it can either try to request it straight from the app (Cross-Origin Resource Sharing can help) or it will proxy it via their own service. Your point about a large video is exactly why we want to support plain url's, so the service can choose to load it however it wants.
With the share example the mime-type dictates what is being shared. A text/uri-list is a collection of links, image/* is any image (either by value or by reference).
You also have to factor in that no browser other than Chrome/Webkit (and Opera) support structured clone so there is no sane way to get the data between app and service. Also, when you say the raw data, in JS the services would potentially need to be able to understand URI's, Data URI's, Typed Arrays, FileRefs having client apps handle all of these will be a pain.
That being said, we will support structured clone, and as long as you can format the type filter to look like a mime-type and both client and service agree the same type you could easily pass an ArrayBuffer through or a plain activity stream. So you might say, I want to send application/js.arraybuffer - and the service would expect to recieve an array buffer.
I'm also a little confused by the
description of the Pink intent. Shouldn't it say somewhere that the data is returned as a result of the intent, not supplied in the request (as for the Share intent)?
The assumption is that the same data type entered is the same that is returned.
Thanks!
Rick