5

I'm developing an android app in which we're going to display some mathematics and physics question with multiple-choice answers. The text of the questions are ready on a Microsoft Office Word .docx format.

The text of the questions usually contains formulas and equations and we want to save them in a SQLite database and access to it on android app.

The real problem is how to manage the displaying part, since to the best of my knowledge, we should manage such complex text with html tags. There are actually about at least 2000 of these questions and we're after an optimized solutions for the problem.

and I'm a tough guy ! :) just give me some keywords and I'll go get it done.

So, please share your experiences and suggestions.

Farhad
  • 12,178
  • 5
  • 32
  • 60
  • So where are you stuck? You can use standard HTML formatting in Android! Also please post a sample line you want to display and where you are finding it problematic. – Skynet Apr 28 '14 at 10:36
  • Yes I've already been thinking of using a WebView for displaying such text. But I tried to copy and paste the text from Word to html and it didn't work. do you have any ideas ? – Farhad Apr 28 '14 at 10:57
  • 1
    Hey, might be [This](http://stackoverflow.com/questions/3235131/set-textview-text-from-html-formatted-string-resource-in-xml) will be of any help? – Skynet Apr 28 '14 at 11:05
  • 1
    I'd have a look at MathML or MathJAX JavaScript libraries. Beautiful LaTeX formulas. – duffymo Apr 28 '14 at 12:05

1 Answers1

2

An easy solution, mentioned in the comments, would be to use MathJAX.

An alternative, if you only have about 2000 formulas, would be to set up TeX on your local machine, generate the formulas, and convert into individual png images.

You could also use HTML+Unicode directly if the formulas are simple.

Charles
  • 11,269
  • 13
  • 67
  • 105
  • Hi Charles, could you give me the link to TeX. Actually, I also thoght about displaying formulas as PNG, but then I should manage the preparation for different screen sizes which is rather smooth, if I know the best dimensions to produce for mdpi , hdpi , .... – Farhad Apr 30 '14 at 08:22
  • @FarhadFaghihi: The most common Windows version is http://miktex.org/ -- for Linux it's usually already installed with most distros. – Charles Apr 30 '14 at 13:24
  • thanks about that, and do u have any ideas or guidelines about managing the size of this PNGs for different screens? – Farhad Apr 30 '14 at 14:27
  • @FarhadFaghihi: Not really. You could just use CSS to display it at a smaller size for some screens, then use it at full size for others. – Charles Apr 30 '14 at 14:32