What is the most efficient way to display mathematical formulas in an Android app?
I am coding for an Android application (for offline use) and I need to display math formulas and expressions in my views. What is the most efficient (easiest if possible) way to achieve this?
The easiest way that comes to my mind is:
Providing it with JavaScript using the loaded MathJax in WebView
.
For example, for such LaTeX, the input:
e^{i \pi} + 1 = 0
This will be the output:
( Euler id )
The most efficient is to simply use a custom font in the TextView. When I was learning MathML I came across a font solution. I'll see if I can dig it up.
Font: https://github.com/fred-wang/android-latin-modern-math
A year later, I found a library that could do this quite efficiently and used it in the current project. This is a link of this great work https://github.com/kexanie/MathView that you can easily include in your own code as another view component. It was much faster than the usual mathjax implementation in webview.