We have moved to a new Sailfish OS Forum. Please start new discussions there.

Revision history [back]

click to hide/show revision 1
initial version

posted 2014-03-01 13:43:26 +0200

JavaScript API for app development

I wonder whether there is any chance to see a JavaScript API (or wrapper application), allowing acess to SailfishOS's backend (or at least most important parts of it) without the need to write C++ code, like

  • Subscribing to phone events
  • isolated file system and database access
  • Controlled access e.g. to contacts, gallery, location, camera...
  • register timers
  • etc.

Advantages

  • Spread: a lot of people know how JavaScript
  • Easiness: getting started with JavaScript is very easy, whichever technical background people come frome
  • Security by default: apps can only access what is published through the API and can easily be isolated (they definitely should be); implementing a fine-grained permission control for apps on top of this API would be easy to do
  • Clarity: the limitations of JavaScript and a well-structured API would make it easy to spot the possibilites/functionalities to be used
  • If I understood correctly, there is already JavaScript support in Qt, so this language would fit perfectly into the technology stack

As a consequence, I would expect more developers to contribute apps for SailfishOS. Maybe app security would even be out of question then - why not have isolated apps based on JavaScript (with strong limitations) and mightier programs allowing additional functionalities with C++ programming (and thus, requiring more trust into the developer, like current applications)?

Not sure whether all of this is feasible, but if so.... I'd love to have it :)

JavaScript API for app development

I wonder whether there is any chance to see a JavaScript API (or wrapper application), allowing acess to SailfishOS's backend (or at least most important parts of it) without the need to write C++ code, like

  • Subscribing to phone events
  • isolated file system and database access
  • Controlled access e.g. to contacts, gallery, location, camera...
  • register timers
  • etc.

Advantages

  • Spread: a lot of people know how JavaScript
  • Easiness: getting started with JavaScript is very easy, whichever technical background people come frome
  • Security by default: apps can only access what is published through the API and can easily be isolated (they definitely should be); implementing a fine-grained permission control for apps on top of this API would be easy to do
  • Clarity: the limitations of JavaScript and a well-structured API would make it easy to spot the possibilites/functionalities to be used
  • If I understood correctly, there is already JavaScript support in Qt, so this language would fit perfectly into the technology stack

As a consequence, I would expect more developers to contribute apps for SailfishOS. Maybe app security would even be out of question then - why not have isolated apps based on JavaScript (with strong limitations) and mightier programs allowing additional functionalities with C++ programming (and thus, requiring more trust into the developer, like current applications)?

Not sure whether all of this is feasible, but if so.... I'd love to have it :)

JavaScript API for app development

I wonder whether there is any chance to see a JavaScript API (or wrapper application), allowing acess to SailfishOS's backend (or at least most important parts of it) without the need to write C++ code, like

  • Subscribing to phone events
  • isolated file system and database access
  • Controlled access e.g. to contacts, gallery, location, camera...
  • register timers
  • etc.

Advantages

  • Spread: a lot of people know how JavaScript
  • Easiness: getting started with JavaScript is very easy, whichever technical background people come frome
  • Security by default: apps can only access what is published through the API and can easily be isolated (they definitely should be); implementing a fine-grained permission control for apps on top of this API would be easy to do
  • Clarity: the limitations of JavaScript and a well-structured API would make it easy to spot the possibilites/functionalities to be used
  • If I understood correctly, there is already JavaScript support in Qt, so this language would fit perfectly into the technology stack

As a consequence, I would expect more developers to contribute apps for SailfishOS. Maybe app security would even be out of question then - why not have isolated apps based on JavaScript (with strong limitations) and mightier programs allowing additional functionalities with C++ programming (and thus, requiring more trust into the developer, like current applications)?

Not sure whether all of this is feasible, but if so.... I'd love to have it :)

Edit: as pointed out by @Fuzzillogic and @MartinK below, Qt Project already offers a substancial API for QML, allowing access to backend functionality via JavaScript.