Hacker News new | past | comments | ask | show | jobs | submit login

Could someone explain me how one can implement offline features like navigation etc for this phone? Is there an API besides HTML+JS?




Thanks!

Hmmh, but all I see is WebApp, WebGL, JavaScript, HTML, ... I don't see 'native' -> How would I implement an offline navigation? (which is currently really not possible in JavaScript)

Or is it just not possible to create a resource intensive or tricky application in FireFox OS?


"How would I implement an offline navigation? (which is currently really not possible in JavaScript)" - wow, just wow. Beyond the fact that this is just plain wrong - there are packaged apps that ship all assets on install, as well as great offline JS libraries - you do realize these things (offline, telephony, etc) are _APIs_ right? No _language_ Just Does™ offline or telephony - for instance, C++ is not somehow magically self-aware of internet connectivity, it's simply a language used by developers to code against device hardware/firmware which then provides _APIs_ for these capabilities.

JavaScript is no less capable of supporting these APIs, look at Node.js for instance, it has most of the server _APIs_ you find in other server implementations that use different languages as a base (and the Firefox platform has many of them already, with many more to on the way!)


Yes, I was wrong: you can create offline navigation with JS! (sorry, for the incorrectness I really like JS, especially on the server!)

But you cannot - please correct me when I'm wrong - create offline navigation on a FireFox OS when using only the provided APIs. At least I don't see a way how it should scale beyond a smallish city.


I'm not sure I understand where you see a limitation that could block you. See my other reply for a more elaborate discussion :)


You don't need native to develop offline applications.

Perhaps this is what you're looking for: https://developer.mozilla.org/en-US/docs/HTML/Using_the_appl...

If you could provide examples of what you mean by "resource intensive" or "tricky", it might be easier to help you.


How would you develop an application to do offline routing like my GraphHopper road routing project?

Such applications have to use the RAM or disc access provided by the OS. A simple cache will not do it. Although I could imagine that JavaScript is fast enough these days you still need access to lots of memory and load several hundred MB from somewhere/disc


Interesting question.

Bulk loading/saving big binary data from/to IndexedDB is basically as fast as accessing the file system. Using TypedArray or (upcoming) BinaryData, JavaScript can also manipulate binary data pretty quickly.

I haven't attempted doing any serious graph processing in JavaScript, but these days, JavaScript is extremely fast at tree manipulation (much faster than OCaml, which has long been the fastest high-level language for this kind of thing), so I would imagine that it's quite suited for the task.

If you are serious about this, you should come and chat on irc.mozilla.org, channel #openwebapps for instance. We'll be happy to help you get started, plus that kind of discussion is often how new features and optimizations get started.


You could download the routing data into IndexedDB and use that for your file system.


And you know how fast that would be? Using an ordinary DB for graph algorithms is already slowish on a powerful server ...


IndexedDB allows direct access to the blobs like a file: https://developer.mozilla.org/en-US/docs/Web/API/FileReader


Intersting! (btw: this is only read only but useful)


There's a writable interface to IndexedDB files as well: https://developer.mozilla.org/en-US/docs/WebAPI/FileHandle



What parts are you meaning there? The USB access? How would I solve the graph processing problem I have in a typically navigation app? Loading the full graph from USB into RAM? Or traversing the graph on a slow USB stick?

I'm still not convinced. I can see the potential for games via WebGL + storage. But especially navigation software looks not really possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: