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 ABF80DB47 for ; Thu, 26 Jul 2012 23:06:50 +0000 (UTC) Received: (qmail 42316 invoked by uid 500); 26 Jul 2012 23:06:50 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 42293 invoked by uid 500); 26 Jul 2012 23:06:50 -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 42284 invoked by uid 99); 26 Jul 2012 23:06:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2012 23:06:50 +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; Thu, 26 Jul 2012 23:06:44 +0000 Received: by ggnp4 with SMTP id p4so2372863ggn.6 for ; Thu, 26 Jul 2012 16:06:23 -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=YNS4CUu/17vaz6LMsya23FAMYTmwm3gySYYDQy7SCq4=; b=A7uAxAoZtNfiNQrwkNAZy75eheuyz6UTS5A6MOzZcxcqKR1wAmTkHSGh9wL/2uNP49 54UmTUGzmzA/7Isod3Zd+Ygf8D4Y8LIfn9m1R80nu+f9m3uNJEQtCoucY20j6vPZzco6 3eNGQrDR2I6t3us4FY+CqpBOcpcKR0gwZ1xWQhpKHqQV4y0Xvl8/qq3ZsfhuvnfkE8z1 A1WHkmIzrTUml7A1rdXVR7SUbeB4PCod0Jy7dO6SJrPmKjtFOCjuXrbfgPf0Nks+kbeG Fn+Mt9dC6GJeNHL+lVsknVTEL6ahxwk3YUGEwOss/g9HdIDZU9mzYvJvXMmMI1MZPCWy DdoA== MIME-Version: 1.0 Received: by 10.236.77.39 with SMTP id c27mr392235yhe.99.1343343983446; Thu, 26 Jul 2012 16:06:23 -0700 (PDT) Received: by 10.236.185.99 with HTTP; Thu, 26 Jul 2012 16:06:23 -0700 (PDT) In-Reply-To: References: Date: Thu, 26 Jul 2012 16:06:23 -0700 Message-ID: Subject: Re: [Android] loadUrl, input methods and making the web a thread-safe place From: Anis KADRI To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=20cf300513bcf1ca6d04c5c3a4be --20cf300513bcf1ca6d04c5c3a4be Content-Type: text/plain; charset=ISO-8859-1 Just one thought: If google thinks it's a bad idea to use loadUrl to execute javascript they should probably start by removing that exact thing from their docs [1]. [1] http://developer.android.com/reference/android/webkit/WebView.html#addJavascriptInterface(java.lang.Object, java.lang.String) On Thu, Jul 26, 2012 at 3: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 > --20cf300513bcf1ca6d04c5c3a4be--