Answer the question
In order to leave comments, you need to log in
Sending data from Android to JavaScript?
Comrades welcome! Help me please.
The Internet is full of examples of passing data from java to javascript via @javascriptiterface in which javascript is the initiator. But I did not find that android sent some data to javascript. Can you tell me who did something like this?
For example, sending GPS data not on request from JS, but automatically when changing position.
You can use a simple example. Thank you.
Answer the question
In order to leave comments, you need to log in
myWebView.loadUrl("javascript:test()");
and declare the function in javascript:function test(){}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question