Android: Is There A Way To Execute Javascript From My App?
I was hoping to find something in the Android sdk similar to the javax.script package in Java; but haven't been able to find anything. Am I missing a way to execute JavaScript fro
Solution 1:
Rhino is a port of JavaScript that is implemented in Java. It can run on Android with minor tweaks. You can find the code for it as part of the SL4A project.
Solution 2:
You could embed an invisible browser and have it execute the script. But perhaps there is a better way.
Solution 3:
You can execute JavaScript from within a WebView
. Make sure you set WebSettings.setJavaScriptEnabled(true)
.
You can find more information here.
Solution 4:
I guess it depends on what you need the JavaScript to do. There is a way to execute JavaScript contained within HTML, ie PhoneGap.
Post a Comment for "Android: Is There A Way To Execute Javascript From My App?"