I'm trying to put in math formulas into my android app, so users can see what the formulas look like, i.e. the distance formula. Is there any way to do this without importing third-party software? Or is that the only way? Thank you in advance.
If you decide you can use a library you could have a look at JLaTeXMath which is referenced in this question or you could try jqMath mentioned here.
If you need to create equations dynamically based on user input, you are probably going to need a library.
You can get some formatting done in HTML and use Html.fromHtml
, but you will be limited. Mostly useful for sub and superscripts. For example,
Html.fromHtml("A<sup>2</sup>+B<sup>2</sup> = C<sup>2</sup>")
gives a rendering of the Pythagorean equation.
If you do not need to dynamically generate equations, but instead have a set of reference equations you want to be able to show unmodified, you can always prerender them as PNGs and display them as images. There are addons to LaTeX, and various online equation editors, such as this one, that will render the PNG for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With