Hey Ben,
Sorry for the late reply. I will be making up a pdf outlining my
proposals for standard activities soon =)
One of the biggest problems that I see with the web activities in Gaia
is the whole blob passing thing (at least in the Gallery app). Blobs
should be allowed (e.g. for viewing a file that doesn't exist yet), but
URIs should be recommended. I think this because there are several ways
(using deviceStorage) to get a blob from a file. For images, you would
use reader.readAsDataURL(), for text files, you would use
reader.readAsText(), and for zips, you would use
reader.readAsArrayBuffer(). This makes it infinitely more complicated
for the sending app, while the receiving app should be able to handle it
fine.
Another proposal that is not directly related to Web Activities: it may
be helpful to define routes for the different storages so that you can
distinguish them just by looking at their URIs. For example: Microsoft
Windows assigns letters (C, A, etc...) to the different storages
connected to it.
As for the parameters passed to the "view" activity, they should be
standardized as well. Some good parameters to include would be
path/blob (duh!), mime, and editability (Boolean value that indicates
whether the file should be read only or not).
Thanks for considering this =)
--
Joshua Smith
On 9/6/13 6:07 AM, Ben Francis wrote:
Hi Joshua,
Thanks for bringing this up. There was an effort in the past
(involving David Flanagan and Mounir) to try to make web activities
more consistent across Gaia and it's probably time we re-visited that.
This work is tracked by
https://bugzilla.mozilla.org/show_bug.cgi?id=796729 and this wiki page
https://wiki.mozilla.org/Gaia/System/Activities
My view is that the web activities you describe should all be of type
"view", with the MIME type or URL specified. I'd be interested to know
what Mounir & David think.
We plan to work on a download manager which allows you to open
downloaded files (around the 1.3 timeframe probably) so we're going to
need to address this for that as well.
Joshua, given that you've been looking at this recently it might be
helpful if you could list your findings so far and highlight where you
see inconsistencies.
Thanks
Ben
On Thu, Sep 5, 2013 at 8:04 PM, Joshua Smith <[email protected]
<mailto:[email protected]>> wrote:
Hello,
I am currently working on a file browser for Firefox OS that is
called Prospector[0]. We are using Web Activities to open files
with other applications, which is expected behavior for any file
browser. I am constantly frustrated by the diversity of the
current activities because they mean that I have to custom-tailor
my code for each file type and application instead of just calling
a broad "open" activity.
It would be /so/ much easier for me, and for other developers of
similar apps to have a standardized Web Activity dedicated to
opening files. Even better would be to have standard properties
for that activity (e.g. file uri, mime, etc...) As for passing
blobs by activities, that sounds like it might hurt perf, and it
is more convenient for the receiving app to handle blob creation
anyway.
Also, a standardized open activity would allow there to be a
settings panel that allows the user to set the default app for
each type of file in place of prompting them every time.
What are your thoughts?
--
Joshua Smith
Links:
0) https://github.com/Codexa/Prospector
_______________________________________________
dev-b2g mailing list
[email protected] <mailto:[email protected]>
https://lists.mozilla.org/listinfo/dev-b2g
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g