0

I have to print the output of my solution(quadratic equation) in below format: Quadratic Equation Format

I have the numeric values and can print the square root symbol using "Square Root: \u221A".

However, I have no clue on how to insert numbers with a root symbol over it and also an underlined division sign as shown in image above.

Please suggest any feasible approach or workaround for this. Thanks!

Saurav
  • 96
  • 1
  • 5
  • Possible duplicate of [How to practically display math formula in Android](http://stackoverflow.com/questions/8359032/how-to-practically-display-math-formula-in-android) – Antrromet Nov 28 '15 at 16:58

2 Answers2

1

There's no native support for equations in Android. You could use MathJax (https://www.mathjax.org/) within a WebView, or a possibly a better option is jqMath, see here:

How to practically display math formula in Android

Community
  • 1
  • 1
Gi0rgi0s
  • 1,757
  • 2
  • 22
  • 31
1

Finally got it working using MathView.

It's a custom view library based on Android WebView and use MathJax to display math formula.

The setup is pretty straight forward too and is specifically developed for Android apps.

<io.github.kexanie.library.MathView
    android:id="@+id/formula_one"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    auto:text="When \\(a \\ne 0\\), there are two solutions to \\(ax^2 + bx + c = 0\\)
            and they are $$x = {-b \\pm \\sqrt{b^2-4ac} \\over 2a}.$$"
    >
</io.github.kexanie.library.MathView>
Saurav
  • 96
  • 1
  • 5