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 C3D92D13C for ; Fri, 27 Jul 2012 05:51:39 +0000 (UTC) Received: (qmail 1645 invoked by uid 500); 27 Jul 2012 05:51:39 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 1441 invoked by uid 500); 27 Jul 2012 05:51:39 -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 1417 invoked by uid 99); 27 Jul 2012 05:51:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2012 05:51:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of purplecabbage@gmail.com designates 209.85.212.177 as permitted sender) Received: from [209.85.212.177] (HELO mail-wi0-f177.google.com) (209.85.212.177) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 27 Jul 2012 05:51:32 +0000 Received: by wibhm11 with SMTP id hm11so1915083wib.0 for ; Thu, 26 Jul 2012 22:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:from:mime-version:in-reply-to:date:message-id:subject:to :content-type; bh=KysVQDDnBckfvGbNUsAQaDXUk3nvw0/EERFDZDxg8UI=; b=h4lwEdI6a6Iv8IcsFQAYLIllOQ+P+tFwJvUCGmoHs5RyOzcTnBqOCf1JG02+rylCb2 2b44uko+ztLPmLxVVWzFAv7L0O4L7dL2N4Lx0quM9QT7b0LuM9ChJvRZlwKz5XqaFM8M F8OfjsGexpjXd2O7qXe5DS9wR3O6aAtPRvS4DCXGLTe61x8PNiRFJIMCAyF1AL610kr3 8sgJa5OdFBZql0HnV7XOUJb15aHEc8le6Ou+3w/urZkzlg49PFR0Dw2otPocK68Ik1uh DRie2+A345s2l/Upzg/JVqW2GD+I8oqTZUz3yVI2jwPKqKMAK1lh4ujepovNqv+sZ8f9 y7lQ== Received: by 10.180.78.135 with SMTP id b7mr3007356wix.11.1343368272115; Thu, 26 Jul 2012 22:51:12 -0700 (PDT) References: From: Jesse MacFadyen Mime-Version: 1.0 (1.0) In-Reply-To: Date: Thu, 26 Jul 2012 22:51:46 -0700 Message-ID: <1144280150015843892@unknownmsgid> Subject: Re: [Android] loadUrl, input methods and making the web a thread-safe place To: "callback-dev@incubator.apache.org" Content-Type: text/plain; charset=ISO-8859-1 We could add a lifecycle event, just like pause/resume so each plugin could react accordingly. ie FileTransfer would discard progress events, but queue the complete event. As an alternative, plugin results could have a property which indicates if they are discardable. Cheers, Jesse On 2012-07-26, at 10:10 PM, Joe Bowser wrote: > It depends. For accelerometer, it may not make sense since it would > just plow a series of events over and over again, and we only care > about the current acceleration, which would be fired on the interval. > Basically, we still have the same problem, except that we break the > native callout instead of the keyboard, which is the lesser of the two > evils. If someone wants both to work, we'll have to either do polling > or go back to the Callback Server. > > But yeah, it would be great if we can send something from Java back to > Javascript without it blocking. > > On Thu, Jul 26, 2012 at 7:56 PM, Simon MacDonald > wrote: >> Okay, I'm working off 4 hours of sleep so if what I say is not coherent >> bear with me. I looked over the code you posted up and it looks like if you >> are in a text field the request to loadUrl is lost. Does it make sense to >> queue up these requests and process them once the user is outside of the >> text field? >> >> Simon Mac Donald >> http://hi.im/simonmacdonald >> >> >> On Thu, Jul 26, 2012 at 6:44 PM, Joe Bowser wrote: >> >>> Hey >>> >>> So, on ICS and greater, it turns out that the routing table is >>> fragile, so fragile in fact that you can't connect to localhost if you >>> don't have an internet connection of some sort. This is a problem for >>> us on Android because we need to connect to localhost to use the >>> bridge and communicate with the Callback Server so that we can get the >>> callbacks. In my opinion, this is the straw that broke the camel's >>> back, and this bug is far worse than the reason we moved to the >>> CallbackServer to begin with. >>> >>> First, some history: >>> >>> Back in OSCON 2010, we talked to Justin at Google about how they could >>> help PhoneGap, and he mentioned that we shouldn't be using loadUrl for >>> sending Javascript over because it is linked to the Handler and can >>> interrupt the UI thread. He suggested a callback server, which Bryce >>> implemented. The callback server and sending commands over the prompt >>> happened at roughly the same six months, when Gingerbread was being >>> rolled out. >>> >>> Now, in 2012, we are starting to have issues with the Callback Server >>> approach, and we should examine why we did this in the first place. >>> The test case for it is simple: >>> >>> 1. Put an input field on the accelerometer page on Mobile-Spec >>> 2. Turn on Accelerometer >>> 3. Try to type something >>> >>> What it will do is it will update the accelerometer values as you type >>> text. This is awesome, but I'm wondering if anyone is actually going >>> to use this use case, and if it's OK to break this functionality in >>> exchange for performance and stability. We currently have the ability >>> to use loadUrl("javascript:foo()") again by checking whether we have >>> focus on a text field, which we can use with HitTestResult, which >>> inspect's webkit's cursor. This would fix the bug that I call >>> "Airplane, Airplane Crash" where you can crash our bridge by switching >>> your phone in and out of airplane mode over and over again. I have a >>> test repository here, and it passes most of Mobile Spec. It would be >>> nice to be able to have this as a configurable option to start. >>> >>> https://github.com/infil00p/callback-android/tree/testbridge >>> >>> Any thoughts? >>> >>> Joe >>>