开发者

Can javascript be used to delegate events to a native android application?

开发者 https://www.devze.com 2023-03-10 07:56 出处:网络
Is it possible to invoke a method or a function of a running android application using javascript?? OR 开发者_JS百科Is there a possible way to communicate between Javascript and native android applica

Is it possible to invoke a method or a function of a running android application using javascript?? OR 开发者_JS百科Is there a possible way to communicate between Javascript and native android application??


Yes, there's such a method. Just use the WebView.addJavascriptInterface() method. It creates a javascript variable which is bound to a java object. You'll be able to call methods of this object from your javascript code.

0

精彩评论

暂无评论...
验证码 换一张
取 消