code_finder
code_finder

Reputation: 1370

How to show special characters in Android?

I am developing a native app which consists of some mathematical formulas.

Formulas will be like.........

Formulas

I want to display such formulas in my application, but i don't how to use these special characters in Android. I want to display each formula individually in a list view...... If i am copying formula & if i am setting text to text view means it is showing like

   txtv.setText("\\cos^2\\theta + \\sin^2\\theta = 1\\! ");

and getting output in the same pattern. So, can anyone help me how to use these mathematical special characters in Android..

Upvotes: 5

Views: 3696

Answers (2)

Waza_Be
Waza_Be

Reputation: 39558

Sorry, there are not a lot of different solutions.. There are no 'magical answer", here are some different ways to achieve what you want.

1) Using a webview with some Javascript

2) using a server to produce a picture of the formula.

3) Using a 9.png file embededd in your app with the square root symbol and display it as textview background

4) Drawing a canvas with all your text and symbols

5) using Hexadecimal code: http://htmlhelp.com/reference/html40/entities/symbols.html

http://tlt.its.psu.edu/suggestions/international/bylanguage/mathchart.html

6) Maybe other ideas, but definitely no way to achieve a 300 formula listview in a easiest way.

Upvotes: 4

Waza_Be
Waza_Be

Reputation: 39558

This one seem quite good and works in Android without any issue: http://mathscribe.com/author/jqmath.html

Edit: You can run this inside a WebView, you don't need any webapp.

Upvotes: 2

Related Questions