Saturday, August 20, 2011

Re: [android-developers] how can i get the data created by function openDatabase from the webview?

thanks a lot, Mark.

but it is really frustrating me.

i was hoping to get a simple resolution to my application..



2011/8/20 Mark Murphy <mmurphy@commonsware.com>
On Sat, Aug 20, 2011 at 11:38 AM, 李白|字一日 <calidion@gmail.com> 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.

because the webview is limited to interact with services or widgets, and my application should be evolved to be a more powerful one, i have to change it to a webview riched and java riched one 



>     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).
 
sad to hear it.. 


--
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
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 android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

No comments:

Post a Comment