我正在尝试在我的 Android 应用程序中显示一些数学方程式,但我不确定您如何使用 JqMath 来显示这些方程式。有人可以逐步告诉我如何在 Android 应用程序上显示一些简单的方程式吗?我尝试了以下方法:
mEquationWebView = (WebView)v.findViewById(R.id.equation_webView);
WebSettings mWebSettings = mEquationWebView.getSettings();
mWebSettings.setJavaScriptEnabled(true);
String path="file:///android_asset/";
String js = "<html><head>"
+ "<link rel='stylesheet' href='file:///android_asset/mathscribe/jqmath-0.4.0.css'>"
+ "<script src = 'file:///android_asset/mathscribe/jquery-1.4.3.min.js'></script>"
+ "<script src = 'file:///android_asset/mathscribe/jqmath-etc-0.4.2.min.js'></script>"
+ "</head><body>"
+ "<script>var s = '$$x={-b±√{b^2-4ac}}/{2a}$$';M.parseMath(s);document.write(s);</script> </body>";
mEquationWebView.loadDataWithBaseURL("",js,"text/html", "UTF-8", "");
并得到以下错误: 无法打开资产 URL:file:///android_asset/mathscribe/jqmath-0.4.0.css 无法打开资产 URL:file:///android_asset/mathscribe/jqmath-etc-0.4.2 .min.js 无法打开资产 URL:file:///android_asset/mathscribe/jquery-1.4.3.min.js
我认为问题可能是我需要将一些 jqMath 文件下载到我的 Android 资产文件夹中,但我不确定在哪里可以找到这些文件。