jqMath does not display equations

156 views Asked by At
WebView webView = (WebView)findViewById(R.id.display);
    WebSettings webSettings = webView.getSettings();
    webSettings.setJavaScriptEnabled(true);
    String path="file:///android_asset/";
    String js = "<html><head>"
            + "<link rel='stylesheet' href='"+path+"jqmath-0.4.3.css'>"
            + "<script src='"+path+"jquery-1.4.3.min.js'></script>"
            + "<script src='"+path+"jqmath-etc-0.4.5.min.js'></script>"
            + "</head><body>"
            + "$$x={-b±√{b^2-4ac}}/{2a}$$</body></html>";
    webView.loadDataWithBaseURL( "file:///android_asset/" ,js,  "text/html",  "UTF-8", null);

I added all the files that I downloaded from here in the assets folder but all I get when I run the app is $$x={-b±√{b^2-4ac}}/{2a}$$ instead of the intended equation. Is there anything that I am missing.

2

There are 2 answers

0
Minion On

Check your path , it is due to the wrong path to your files , i guess you have stored the mathscribe folder in assets , and then you are using this code , you have to modify the path if you have saved the complete folder mathscribe in asset . new path

String path = "file:///android_asset/mathscribe/"

hope this will be helpful ....

0
yasirbhat564 On

The file name in the js variable has to be the same as that in the assets folder.I think you have downloaded the latest version of files but copy pasted the code from some older thread.