How to execute JavaScript on Android?

后端 未结 10 1423
迷失自我
迷失自我 2020-11-27 14:38

I have code which uses ScriptEngineManager, ScriptEngine class for executing JavaScript code using Java. But it works fine in Java SE, and doesn\'t work in Android - SDK sh

10条回答
  •  Happy的楠姐
    2020-11-27 14:59

    Given that ScriptEngineManager and ScriptEngine are part of the JDK and Android SDK is not the same thing as the JDK I would say that you can't use these classes to work with JavaScript under Android.

    You can check the Android SDK's reference documentation/package index to see what classes are included (what can you work on Android out of the box) and which of them are missing.

提交回复
热议问题