Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display math formulas into my android app? [closed]

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.

like image 814
Alan Wang Avatar asked Jan 16 '13 03:01

Alan Wang


2 Answers

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.

like image 91
n00begon Avatar answered Nov 16 '22 14:11

n00begon


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.

like image 28
iagreen Avatar answered Nov 16 '22 15:11

iagreen