W3C home > Mailing lists > Public > public-device-apis@w3.org > September 2012

RE: When should a Device API be exposed? Re: Atmospheric pressure sensosr API

From: Josh Soref <jsoref@rim.com>
Date: Fri, 7 Sep 2012 14:28:26 +0000
To: DAP <public-device-apis@w3.org>
Message-ID: <957F1ECDA90E004B8DBDE23CFC94E3A33A54A4BA@XMB103ECNC.rim.net>
Marcos wrote:
> Sorry.. dumb question, but I can't ever remember the answer: if a hardware (or
> similar) capability is not available on the host device, should the API be exposed
> by the UA? I thought I had read somewhere (HTML spec? WebIDL?) that the UA
> should not expose the API when the capability is not available.
> 
> I'm asking because I saw the following in the Atmospheric API proposal: "Not all
> devices contain a barometer, and when there is no barometer, this API is still
> exposed to the scripting environment but it does nothing".

Yeah, that runs counter to the behavior we generally accept.

This entire approach is also why I'd much rather we do these APIs as Intents.

Doing it as an Intent allows the host to provide a host-OS/Device based Intent provider if it's available, but allows the user to connect a web service or Bluetooth device or whatever if they want to interact with the application but their hardware/OS doesn't have the necessary support.

---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.
Received on Friday, 7 September 2012 14:29:04 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 7 September 2012 14:29:04 GMT