M
M
My joy2016-03-12 18:36:12
Android
My joy, 2016-03-12 18:36:12

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

2 answer(s)
D
Denis Zagaevsky, 2016-03-12
@t-alexashka

myWebView.loadUrl("javascript:test()");and declare the function in javascript:function test(){}

G
GavriKos, 2016-03-12
@GavriKos

Look towards Sockets/WebSockets.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question