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 6324897E1 for ; Mon, 12 Dec 2011 21:36:44 +0000 (UTC) Received: (qmail 17108 invoked by uid 500); 12 Dec 2011 21:36:44 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 17084 invoked by uid 500); 12 Dec 2011 21:36:44 -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 17076 invoked by uid 99); 12 Dec 2011 21:36:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 21:36:44 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of dave.c.johnson@gmail.com designates 209.85.216.54 as permitted sender) Received: from [209.85.216.54] (HELO mail-qw0-f54.google.com) (209.85.216.54) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Dec 2011 21:36:34 +0000 Received: by qabg14 with SMTP id g14so4837651qab.6 for ; Mon, 12 Dec 2011 13:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=8e6EBB8x7hAcKlC5msjLzsPI2UxT4Xa/p23ohCjPWSw=; b=noCYLy5ulj7RRG2GlTD0tGJdiwySMaDXfOl84FbvcoarRSF+KXgDh4Mf8FWyp3N0pq m8vA574k6cL7eFVPsOOW4cafJTRY2L+tSjZtfDKAuwRyVMWf+CtuFqW4jEluZ1x1UFHY KRszM5Kg3c/pOgaQGInPQ30e5BwyX8S/vfJNU= Received: by 10.224.186.8 with SMTP id cq8mr19234512qab.45.1323725773941; Mon, 12 Dec 2011 13:36:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.91.140 with HTTP; Mon, 12 Dec 2011 13:35:51 -0800 (PST) In-Reply-To: References: <-4848153779676846049@unknownmsgid> From: Dave Johnson Date: Mon, 12 Dec 2011 13:35:51 -0800 Message-ID: Subject: Re: CordovaView?? - A proof of concept of making a custom Android View with Cordova Web APIs exposed To: callback-dev@incubator.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org +1 on this as well. The thing that struck me when Joe mentioned that back button etc don't work is that this makes it pretty clear what sort of functionality is app functionality vs control functionality - in this case android hardware buttons are clearly app functionality that should have nothing to do with the control use case. If that is true about the buttons not being in the view control on android then I think there is still a need for a CordovaActivity / CordovaDelegate sort of thing on Android / iOS that your main application can inherit from. We would also want a CordovaView control that could hook into the activity with no problems for the Cordova app use case, however, you could also just write your app from scratch (e.g. not inheriting CordovaActivity) and deal with hooking up intents / buttons / etc and use multiple CordovaViews in the app. Make any sense? On Mon, Dec 12, 2011 at 1:15 PM, Matthew Schulkind w= rote: > Just to add my two cents here... > > I'm currently working on an app and set of plugins that use native chrome > on iOS (and eventually Android) exclusively. I don't even show the webvie= w, > I just have it added as a view somewhere, yet hidden, so it still works. > > Interestingly for my plugins, even though I use class variable singletons > for some bookkeeping, my design would hardly even have to change to suppo= rt > multiple webview instances. I suspect this will be the case with most > plugins as well. > > I think the real question is what state do plugins normally keep track of > in global sorts of ways? > > Consider something like a selecting a photo from the library. The plugin > likely keeps track of if the modal picker is currently showing. You'd > probably want this shared across webview instances. > > I personally don't see any way of aiding plugins much in this refactor du= e > to issues like this. > > TL;DR: +1 to Brian > > On Mon, Dec 12, 2011 at 4:07 PM, Brian LeRoux wrote: > >> I think Patricks concern is less about oop basics and more about how >> we plan to address shared state. He's right. Its a rats nest and could >> cause big headaches. >> >> The basic use case here is for app developers that demanding native >> chrome. (The usual reason here is for better performance. And yes, >> that is debatable and especially so as browsers get better.) We saw a >> trend w/ Twitter, Facebook and LinkedIn essentially using a >> PhoneGap-like approache but w/ native chrome and wanted to look at >> supporting it. >> >> Anyhow, the goal of having PhoneGap as a WebView replacement isnt for >> PhoneGap applications but rather to fullfil a use case wherein ppl >> want embedded webview in an application that has device access (and >> possibly as jesse mentioned even multiple webviews for better >> animations [which I find atrocious]). Plugins do not factor into that >> use case, in my opinion, because the developer is no longer developing >> a phonegap app. He is developing a native app w/ embedded webview(s). >> >> So should we worry about plugins when PhoneGap is being embedded? For >> the first cut of this: no. In the future? Possibly, but as the browser >> improves... likely it won't even be necessary. If it was at all. >> Anyhow, from my perspective the work to get plugins sharing state >> correctly across webviews is picking a losing battle for short term >> gain. >> >> >> On Sun, Dec 11, 2011 at 2:57 AM, Jesse wrote: >> > The control is storing/creating/managing it's own instances of the >> > Commands/Plugins. >> > This could potentially break plugin code in a multi-gap-view world, bu= t I >> > am considering making those decisions out of scope for this >> > effort/iteration. >> > The main use-case I am working to enable is having PhoneGap functional= ity >> > in any app. Essentially the default PhoneGap app that users will build= on >> > iOS will be a simple application container with 1 PhoneGapView. >> > >> > After this iteration, we can then move on to define all kinds of thing= s, >> > like one view instantiating another, and communication between them. ( >> sexy >> > animations, ... ) >> > General advice for plugin developers would be "don't assume that there >> will >> > only ever be one instance of your class", although in OOP this should = be >> > common sense. >> > >> > >> > On Sun, Dec 11, 2011 at 1:17 AM, Patrick Mueller >> wrote: >> > >> >> On Sun, Dec 11, 2011 at 01:40, Jesse MacFadyen > >> >wrote: >> >> >> >> > I am working on a similar refactor of iOS code. Moving the majority= of >> >> > the code into the view controller and out of the application. >> >> > This will allow the use of a phonegap view in any application, not >> >> > just a PhoneGapApplication subclass. >> >> > >> >> >> >> I wasn't quite sure what Joe was talking about in his post, but if I >> read >> >> Jesse's note correctly, this is a move from a "application-centered" >> >> version of the Cordova runtime to a "control-centered" one. =A0+1 on = this. >> >> >> >> I'm curious as to the affects on plugins when we move to >> "control-centered" >> >> from "application-centered". >> >> >> >> 1) are plugin instances shared across multiple controls? =A0Or does e= ach >> >> control get their own private instance of each plugin? =A0Or - it it = more >> >> complicated than that? >> >> >> >> 2) even if plugin instances aren't shared across multiple controls, >> >> presumably a plugin may be using "static" sorts of storage, which >> basically >> >> makes their plugin instances shared across multiple controls despite = the >> >> fact that they aren't designed to be. =A0Meaning, you shouldn't be st= oring >> >> any control-specific data in static-ish data areas in your plugin. >> >> >> >> I think there are issues here, w/r/t plugin design, that go along wit= h >> this >> >> "control-centered" version of Cordova, and we need to get those spell= ed >> >> out. =A0It might just be a note on dangers of using static-ish storag= e. >> >> >> >> -- >> >> Patrick Mueller >> >> http://muellerware.org >> >> >>