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 E5A72D55F for ; Fri, 10 Aug 2012 17:40:05 +0000 (UTC) Received: (qmail 70022 invoked by uid 500); 10 Aug 2012 17:40:05 -0000 Delivered-To: apmail-incubator-callback-dev-archive@incubator.apache.org Received: (qmail 69957 invoked by uid 500); 10 Aug 2012 17:40:05 -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 69949 invoked by uid 99); 10 Aug 2012 17:40:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2012 17:40:05 +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 (athena.apache.org: domain of agrieve@google.com designates 209.85.214.175 as permitted sender) Received: from [209.85.214.175] (HELO mail-ob0-f175.google.com) (209.85.214.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Aug 2012 17:40:01 +0000 Received: by obc16 with SMTP id 16so2503859obc.6 for ; Fri, 10 Aug 2012 10:39:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-system-of-record; bh=r2rqm9Kb4FHbxWfCUr2ZPT5qG8aK52XAof/tAzZSgUA=; b=oSZ75tACjaBhmV3g5lrpV41DmMdwLtVwbH2xwIJeFMUBwiy5JM4lf4/6NNjH1NWz4c SNPWBnht7UODe80dyoLXxijxkawD//lOOcO15qX7uFWOKFjwh6FZbw0b8aP5eBWPF7jJ Gw++8FI6uTr03m9GF8/zMyiCCcmQBu9sU6X2Kr/Ny3PJrgXo5Cr9sFwC8JOrY71N1yEv lfAz2hmMk+rLZLvpL9/K5xIUQVbr5zk1fd3Sa4TLWK1lbTmDr5z290T8cEQKDK8aEqAV snnBt4lYQhB7TZJK3awyVmkyITG4FJdshtxMIzSJzHe6fUTMnfXT4wddqKg3niQMet9y V59Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :x-system-of-record:x-gm-message-state; bh=r2rqm9Kb4FHbxWfCUr2ZPT5qG8aK52XAof/tAzZSgUA=; b=SlJFldEm458REDj6NPWbccABb/thrag4su6+xRLof1W8WZeGMpjbCxTKsvhjT5AEfr dFhf58Jsi0W8bqOYwD+TnBf5mqG57z7vjRDmFwnoi4m1xZGlI8wNFgFSEwZ+DKQymXVU KRhPIZuCvu8SGBNt1dbS0vWbNTSVNFTujZ7RpoPzRfPyARYmPQvGEIPIugp/SmrkhMp0 f2ae194Sm70PgZl1smOOaFSiMUOVP3HbihHqJ66YR48+w89pTmFY9atbpVXxJ6eP8BcE kRkOOGEZxkjqgXzlyCqSrhJiARWsoqtkvyRY0Ty6RrbxEB4ewAdTfon/kHv2TXd8f2A/ 16gw== Received: by 10.182.74.68 with SMTP id r4mr5278864obv.31.1344620380379; Fri, 10 Aug 2012 10:39:40 -0700 (PDT) Received: by 10.182.74.68 with SMTP id r4mr5278847obv.31.1344620380212; Fri, 10 Aug 2012 10:39:40 -0700 (PDT) MIME-Version: 1.0 Sender: agrieve@google.com Received: by 10.182.207.97 with HTTP; Fri, 10 Aug 2012 10:39:20 -0700 (PDT) In-Reply-To: References: <1144280150015843892@unknownmsgid> <04a201cd7706$49c0e5a0$dd42b0e0$@com> From: Andrew Grieve Date: Fri, 10 Aug 2012 13:39:20 -0400 X-Google-Sender-Auth: 0PZnzUVlRJu1AX08AUtBuOwdWHw Message-ID: Subject: Re: [Android] loadUrl, input methods and making the web a thread-safe place To: callback-dev@incubator.apache.org Content-Type: multipart/alternative; boundary=f46d04447ea91eccf004c6ecd4b0 X-System-Of-Record: true X-Gm-Message-State: ALoCoQm7ou15wFDThrYnr49t9n83PvO/C8+QDN3jUi51E3sa+CTnmN6iAsAkq28Hh/MGTIKc/iRwOjv8KSIFMIXVv8An0ggde3L76InRiWiHy7pv9fNrqoJv+ZrqYP5TyoVxbOXzMA81oBmM3UuYDYTkgQbc6M+teziGPQ8Py3JlJgFKpYPKqS/5stXhM1WPz5lEJpdnNO0lsuwnj0QY8ckCQ2sTaanVyg== X-Virus-Checked: Checked by ClamAV on apache.org --f46d04447ea91eccf004c6ecd4b0 Content-Type: text/plain; charset=ISO-8859-1 Calling the private sendMessages() to eval JS doesn't have the same with dismissing the keyboard, although it's quite possible that it will have other bugs. If nothing else, I think it would be neat to add it as togglable options so devs can try it out and see if it causes any bugs. Another risk is that the added WEBKIT_DRAW that seems to be required will make it slower than other options. Instead of online/offline events, we could turn polling on when a textbox is focused and turn it off when it blurs. This might increase typing lag though... I'm also not how straight-forward it is to detect if the keyboard is active due to ContentEditable. Joe, I'm sure you looked at this when it came up with the 2.3 emulator, but is there a way to detect that you're in the emulator? On Fri, Aug 10, 2012 at 12:59 PM, Joe Bowser wrote: > If you use WebView.loadUrl("javascript://foo()"), loadUrl strips the > javascript:// and runs stringByEvaluatingJavaScriptFromString. I > believe the reason that Google hides and obfuscates this is because it > can do some weird things with the UI that is rendered on top of it. > (i.e. Text/Password Boxes, Check Boxes, Select Buttons, etc). > > I personally like the online and offline event overloading, as long as > we can keep real online and offline events working properly. We did > have polling as a backup in the past with the jsPrompt overloaded. > While addJavascriptInterface is cleaner, I can see more backlash from > our community for breaking the emulator. That should be taken in > consideration, although this only breaks the Google 2.3 emulator, and > I don't think it affects Motorola or Sony emulators, which devs should > be downloading anyway (unless they have an unlimited budget). > > On Fri, Aug 10, 2012 at 7:41 AM, Jonathan Bond-Caron > wrote: > > On Thu Aug 9 11:07 PM, Andrew Grieve wrote: > >> > >> Going Native->JS > >> 1) Poll using 1) from above. (async) > >> 2) Poll using 2) from above. (async) > >> 3) Use loadUrl (breaks keyboard) (async) > >> 4) Trigger an online/offline event and have JS pull in value using a > >> sync > >> JS->Native option (async) > >> 5) Use a local server and hanging gets (async & complicated) > >> > >> Notes: > >> -We currently use a combination of #1 and #5 > >> -#3 is faster and simpler but breaks keyboard focus > >> > > > > Out of curiosity, has anyone asked google why this is such a PITA? > > > > iOS has: UIWebView.stringByEvaluatingJavaScriptFromString > > > > The native java code binding to webkit already exists: > > > https://github.com/android/platform_frameworks_base/blob/master/core/java/an > > droid/webkit/WebViewCore.java#L1673 > > > https://github.com/android/platform_external_webkit/blob/master/Source/WebKi > > t/android/jni/WebCoreFrameBridge.cpp#L1489 > > > > Yet google 'hides' this API? Anyone know why? > > > > > --f46d04447ea91eccf004c6ecd4b0--