Return-Path: X-Original-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-callback-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A6806DB0E for ; Mon, 22 Oct 2012 21:19:43 +0000 (UTC) Received: (qmail 94794 invoked by uid 500); 22 Oct 2012 21:19:43 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 94759 invoked by uid 500); 22 Oct 2012 21:19:43 -0000 Mailing-List: contact callback-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: callback-dev@incubator.apache.org Delivered-To: mailing list callback-dev@incubator.apache.org Received: (qmail 94750 invoked by uid 99); 22 Oct 2012 21:19:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 21:19:43 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of anis.kadri@gmail.com designates 209.85.161.175 as permitted sender) Received: from [209.85.161.175] (HELO mail-gg0-f175.google.com) (209.85.161.175) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Oct 2012 21:19:37 +0000 Received: by mail-gg0-f175.google.com with SMTP id p1so610896ggn.6 for ; Mon, 22 Oct 2012 14:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ib7JvWF8QkzGWjIMCaYQ6Y8R778B7VgPbNnY5TNLsF4=; b=rONsVOLbSnkR83T+qkHvFaxv9I1Mr7oEUSa2TV6YpWctJCLnQu5TkV9NGJo7V98RJK nVh/D3As0upDnGhFHajZ7SyuWrYxFdowl5rB0YaKJg3I8M1ZansdRz4kr3HxQapHPUj7 zeg+4RT8LYiWB1Kux1o1ZzfOoACzIXMSfrcfXIEEWcD90gTmuV0sif0HDQqDbxMQLhjY E1R7p7b9WDx0vjVpXG1XU9lQf7iUNguYW+v319JvA6Ufa0NhzoXX7VMlGkqBUwXE41Nn /t5HzFbZSkWNBPQpzquH4BsiJldVrtcua9+Hqip/yEaC2GtsKguUSGiKhKLKiZY6Db2q joRg== MIME-Version: 1.0 Received: by 10.236.135.110 with SMTP id t74mr9909218yhi.4.1350940756442; Mon, 22 Oct 2012 14:19:16 -0700 (PDT) Received: by 10.236.144.168 with HTTP; Mon, 22 Oct 2012 14:19:16 -0700 (PDT) In-Reply-To: References: Date: Mon, 22 Oct 2012 14:19:16 -0700 Message-ID: Subject: Re: capabilities api From: Anis KADRI To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=20cf301af871e67ff304ccac67de X-Virus-Checked: Checked by ClamAV on apache.org --20cf301af871e67ff304ccac67de Content-Type: text/plain; charset=ISO-8859-1 It could get populated/updated by the plugins in charge. The purpose is informational. If a capability is disabled/not present then the capabilities object will just have that info. I like the one object approach myself. I would include it as a device property though. Something like: device.capabilities.* On Mon, Oct 22, 2012 at 2:03 PM, Filip Maj wrote: > I would take it one step further and have it be the responsibility of the > plugin in the first place to track the capability. > > I don't like a flat `capabilities` object that is decoupled from the > plugin in charge of it in the first place. How would this even fit in a > fully-pluginable Cordova environment anyways? A "capabilities" object that > is part of the cordova "core"? Wouldn't this also force all future cordova > apps, even without any plugins installed, to require all permissions for > platform(s)? > > On 10/22/12 12:44 PM, "Andrew Grieve" wrote: > > >I like device.capabilities or directly on device. > > > >Maybe a naming convention would be a good idea for the different types of > >things? > > > >Figuring out the properties might take some time. e.g. we may not need a > >bool for frontFacingCamera, but instead: > > > >capabilities.cameras = [ { direction = {'front'/'rear'/'external'}, > >'resolution': '1.2MP' }] // an empty array if no cameras > >capabilities.frontCamera = ref to the first cameras entry with > >direction='front', or null > >capabilities.rearCamera = ref to the first cameras entry with > >direction='rear', or null > > > >Other examples: > >capabilities.locationSensors = [{type:'gps'},{type:'wifi'}] > >capabilities.gps = ref to {type:'gps'} > > > > > >Do we want any information about the current state of sensors? E.g. > >bluetooth currently enabled/disabled. My vote would be no, and that this > >kind of info should be the responsibility of a bluetooth plugin. > > > > > > > > > > > > > >On Mon, Oct 22, 2012 at 2:55 PM, Brian LeRoux wrote: > > > >> The longer view would seem that we would want to think this through > >> more and give a unified API for any kind of device hardware/sensor > >> inquiry. I'm a fan of keeping that decoupled from interacting w/ the > >> objects of introspection too---this should be a core part of the > >> platform. > >> > >> window.device.capabilities.* bucket feels right > >> > >> > >> On Mon, Oct 22, 2012 at 9:06 AM, Josh Soref wrote: > >> > For his specific requirement "I need to know if there's a camera", > >> certainly the camera API could choose not to be available if there's no > >> camera, and merely: > >> > > >> > window.device.camera == false ? > >> > > >> > or wherever cordova puts the camera. > >> > > >> > A capabilities API is absolutely overkill for his requirements. > >> > > >> > (And yes, that W3 RDF monstrosity is too, but that's no reason to even > >> look at it...) > >> > > >> > If the requirement is "I want to be able to lazy load the camera > >>plugin, > >> and only if there's a camera available", that seems to violate the > >>plugin > >> model, and the response should be "we promise to try to make the camera > >> module load/fail quickly if there are no cameras available". > >> > > >> > --------------------------------------------------------------------- > >> > 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. > >> > > --20cf301af871e67ff304ccac67de--