3

I would like to know if possible is to get data from webview. I mean I have form in webview. I want to click submit in form in this webview and I want to get data from every field and save that data in database. This is possible?

edi233
  • 3,511
  • 13
  • 56
  • 97
  • To get data from a WebView in Android : https://stackoverflow.com/a/76415649/12272687 – Mori Jun 06 '23 at 14:20

1 Answers1

3

Yes it is possible, use addJavascriptInterface in your webview, get click event using JS then call a android function using javascript interface.

See Binding JavaScript code to Android code

Arun C
  • 9,035
  • 2
  • 28
  • 42
  • **This works for Android only.** The interface will also be called if the user is viewing from desktop or even an iPhone running iOS and cause an error. Any suggestion to a cross-platform method of doing this? – Jonas Borggren Nov 21 '14 at 15:04