3

我在阅读和显示数学和科学公式时遇到问题。它们没有像下面给出的图像那样出现。我将它显示在 中TextView,并且我曾经setTypeface将字体设置为“古吉拉特语”字体。

先感谢您。

我想显示数学公式,如:

在此处输入图像描述

...并显示科学方程式,例如:

在此处输入图像描述

还有,如何在 Android 中读取 Excel 表并存储在 SQLite 数据库中?我不使用.csv,因为我将古吉拉特语数据存储在 Excel 中。

4

4 回答 4

3

您可以使用 value 文件夹中 string.xml 文件中的 HTML 代码显示数学函数。像例子:

<string name="superscript"><html><i>a</i><sup>2</sup>+<i>y</i><sup>2</sup></html></string>
<string name="subscript"><html>f(x)<sub>1+x</sub></html></string>

并在您的 xml 文件 TextView 中写入:

 <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/superscript" />

   <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="@string/subscript" />

对于数学符号和字符,您可以查看此链接:

http://en.wikipedia.org/wiki/Help:Displaying_a_formula

http://barzilai.org/math_sym.htm

http://www.myphysicslab.com/web_math.html

于 2012-12-01T06:32:09.503 回答
2

对于 Excel ti SQLite3,快速搜索会引导我找到这些:

如何将excel表格转换为android中的sqlite数据库

如何在android程序中读取excel表

http://www.razorsql.com/features/sqlite_import.html

于 2012-12-01T05:14:25.057 回答
1

对于第一个问题的解决方案在 android 中使用 MAthJAX

http://cs.jsu.edu/wordpress/?p=498

很容易

于 2014-01-09T12:23:21.107 回答
0

您可以使用 ImageView 并显示这些表达式的图像。这很容易。

于 2012-12-01T05:07:13.720 回答