Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
230 views
in Technique[技术] by (71.8m points)

java - How can I call native functions in Phonegap through Javascript?

I am developing an application for Android using PhoneGap. I have implemented some of the functions in Java. How can I call those Java functions using Javascript?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

there is a similar question https://stackoverflow.com/a/8733773/905565

Write your own plugin, or provide JavaScript interface with addJavascriptInterface method of WebView

Access to webview in your phonegap activity with this.webView


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...