thanks,
it seems a quite reasonable way by now.
it adds two questions to me:
1. how to invoke javascript only without loading a webview?
2. how to pass a callback to javascript and make java invocation
synchronous?
would you please give me some advise or hints, Mark?
2011/8/20 Mark Murphy <[email protected]>
> On Sat, Aug 20, 2011 at 9:15 AM, 李白|字一日 <[email protected]> wrote:
> > because my application is based on webview,
> > it is not a good way to change it again to java api based which may cause
> > the data lose for users.
> > and web apps will be my focus later.
>
> Then don't access it from the Java code. Use loadUrl("javascript:...")
> from Java to execute some JavaScript that calls an API that pushes the
> data from the WebView back into your Android app via an interface
> defined via addJavascriptInterface().
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> _The Busy Coder's Guide to Android Development_ Version 3.6 Available!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en