MathView
is a library to render Math equations in Android. It uses jqMath to render math equations.
Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
Add implementation 'com.github.frhnfrq:MathView:1.2'
into dependencies section of your module build.gradle file. For example:
dependencies {
implementation 'com.github.frhnfrq:MathView:1.2'
}
<com.zanvent.mathview.MathView
android:id="@+id/mathview"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
MathView mathview = findViewById(R.id.mathview);
mathview.setText("If $ax^2+bx+c=0$ with $a≠0$, then: $$x={-b±√{b^2-4ac}}/{2a}$$");
mathview.setPixelScaleType(Scale.SCALE_DP);
mathview.setTextSize(16);
mathview.setTextColor("#111111");
To learn how to write math equations in it, please have a look at jqMath.
- Faster than MathJax.
- Change text size and color easily.
- Supports HTML outside of the equation. Example
mathview.setText("This is a <b>straight</b> line, $\ax + \by = \c$");
- Special symbols are typed manually. Example: √ ∑ ∫ ← → + >
- Some parts of the MathML standard are not yet implemented in jqMath, such as elementary school mathematics (e.g. “long division”), and “Content MathML.”
Copyright 2018 Farhan Farooqui
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.