On Sat, Aug 20, 2011 at 11:38 AM, 李白|字一日 <[email protected]> wrote: > it adds two questions to me: > 1. how to invoke javascript only without loading a webview?
Um, you can't, unless you add Rhino or another JavaScript interpreter to your project. Moreover, you seem to be missing the point. You EITHER need to write a Java-centric app that HAPPENS to use a WebView for a bit of rendering (and therefore the database should be managed by Java code) OR you need to write a WebView-centric app that HAPPENS to need a bit of Java code here and there (and therefore the database should be managed by the JavaScript code). If there are situations where you have Java code needing access to the data with no WebView around, then, by definition, you are writing a Java-centric app. > 2. how to pass a callback to javascript and make java invocation > synchronous? Very little is guaranteed to be synchronous in this space, because AFAIK WebView uses its own threads (from WebKit). -- 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

