-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement proposal : use DeviceStorage API as an alternative to FileSystem API #1
Comments
Porting to Firefox OS is an important objective. I have already joined the Phones for App Ports programme, expecting the Keon to arrive soon. I'd still appreciate any help. :) It should be noted that TCP server and UDP sockets are scheduled to arrive in Firefox OS 1.2! There's not much point in P2P apps if you cannot open TCP server sockets. One area where you could especially help is to implement an interface to let other apps & websites communicate with Bitford. Anyway, thanks for telling me about DeviceStorage. However, I dropped Chrome's FileSystem API in favour of IndexedDB because the former does not support sparse files and seemed to have issues with concurrency. After that, new buffer logics have lowered pressure on the storage backend. So I'm confident to try that once Bitford runs on Firefox OS with IndexedDB. |
That's really cool! Regarding communication between apps, there's at least the Web Activities. See https://hacks.mozilla.org/2013/01/introducing-web-activities/ Regarding IndexedDB, that means that the downloaded file itself is stored in it, as a big blob? In any case, my congratulations for being accepted in the Phones for App Ports program! |
Sounds like that could work with Web Activities! File size is not an issue, because the data is not stored in one large chunk. For streaming, Bitford serves the data as an HTTP resource over localhost. I fear the Keon will be quite low-end... |
I've never implemented Web Activities myself, but it looks like it can be (easily?) feasible, yes. Regarding the file storage, if I understood correctly, the files are not readable on the filesystem by another application (if IndexedDB is used). It is split in chunks stored in the indexedDB tables. Regarding the Keon, it has a single core 1.2 GHz ARM processor and 512MB of RAM. |
Hi! |
I've done some experiments with TCP client sockets but will wait until FxOS 1.2 for UDP and TCP server sockets. There's some shim code in my sawrocket repository. In general the capabilities of the APIs are a bit disappointing. Examples: customize controls in notifications, get the number of visible GPS satellites, ... |
It's a request I had made for https://github.com/kzahel/jstorrent , but you already know it has disappeared.
The FileSystem API is only available on Chrome.
But Mozilla implemented the DeviceStorage API that should let you do the same things. You get File objects, on which you can read/write some slices.
See https://developer.mozilla.org/en-US/docs/Web/API/DeviceStorage
and https://wiki.mozilla.org/WebAPI/FileHandleAPI#Atomic_increment_of_a_counter_somewhere_in_the_file
This DeviceStorage API is currently implemented on Firefox OS (you can test it on the Firefox OS Simulator : https://addons.mozilla.org/en-US/firefox/addon/firefox-os-simulator/ ), and is planned to be available on Firefox Android and desktop. See https://wiki.mozilla.org/index.php?title=WebAPI
It would make your app available on some more devices.
And it also might let you win a Firefox OS phone : https://hacks.mozilla.org/2013/09/calling-all-app-ports/ ;-)
NB : it would also be very useful for an application I made, for which the user needs to download big files with bittorrent. For now it's not possible to download them from the device itself. See kiwix/kiwix-js#19
The text was updated successfully, but these errors were encountered: