2

I wonder if it's possible to obtain Javascript variable value from Java code. In other words, I've got JS code in WebView and I need to be able to obtain variables from that JS code from WebView.

1 Answer 1

3

Yes it's possible by installing Java-JS bridge and then injecting JS into page that collects the data and returns it via JS bridge. See this answer: How to call javascript from Android?

Sign up to request clarification or add additional context in comments.

3 Comments

Just want to add that the bridge broken in android 2.3 and you will require a hack for that version
@shawndreck is correct. It's unbelievable that this still isn't fixed. code.google.com/p/android/issues/detail?id=12987
@shawndreck - I face this same problem in Android 2.3...can u suggest me that hack u were talking about.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.