Can I use javax.script in Android development and if yes how?

谁说我不能喝 提交于 2020-02-03 05:39:06

问题


I'm having a bit of trouble with including javax.script.*; in an Android project. I need it so I can use the "eval" function in JavaScript, in order to parse arithmetic functions efficiently, without building a parser myself (I have utterly no experience in that and not a lot of time on my hands).

Is there any chance to use JavaScript or the "eval" function or something similar in my Android app?

Thanks for any info you can give me


回答1:


Execute the JS code with webview




回答2:


Try JEXL. It should do what you need but is simpler than the entire Javascript interpreter.



来源:https://stackoverflow.com/questions/6967824/can-i-use-javax-script-in-android-development-and-if-yes-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!