-3

I have this javascript code:

<html>
<head>
<script>
for(i=0;i<6;i++)
{
document.write("my number is "+ i );
}
</script>

</head>

</html>

I want to take the output of this javascript code and save in String in android. like this:

my number is 0my number is 1my number is 2my number is 3my number is 4my number is 5

How can i do this in android?

Lucas Zamboulis
  • 2,494
  • 5
  • 24
  • 27

1 Answers1

0

There are a lof of topic already opened/answered for this question.

Check these links

using javascript in android webview

Android Calling JavaScript functions in WebView

Basic is binding your WebView injecting a javascript into the webpage, then you can call your java function in webpage with normal javascript.

Community
  • 1
  • 1
MatPag
  • 41,742
  • 14
  • 105
  • 114