views:

39

answers:

1

Hi

I have used HTML/CSS/js to make UI for my android app. (port from iPhone app)

One of the HTMLs contains a form. I need to get the values entered in that form and use them in android code. the target of the form is the page itself and the method is GET.

How can i get the values entered by the user in that form?

A: 

You can use addJavascriptInterface() of WebView to expose some java objects to your javascript, also you can pass to the WebView load requests with "javascript:" prefix to invoke any javascript code from Java.

Here is quite a good tutorial:

http://whyandroid.com/android/206-using-webviews.html

I think that with help of the techniques it should be trivial to get any values from html.

UPD: Also take a look on the answer http://stackoverflow.com/questions/2280298/how-to-retreive-java-script-function-value-in-webview-component/2280776#2280776

Konstantin Burov