'How to write special characters in Android

I want to add units to my TextView, such as power (^2, like small letter above the line of text), micro symbol (µ), etc.

Someone know how to do this ?

Thanks!



Solution 1:[1]

yes you can use Unicode characters for your Textview

TextView tvtext = new TextView(this);
tvText.setText("unicode characters \u00B5");

you can find Unicode for all characters

http://unicode-table.com/en/

Solution 2:[2]

Try adding this in your strings.xml

μ

HTML Entity (decimal)   μ
C/C++/Java source code  "\u03BC"

Link: URL reference

Solution 3:[3]

You can use:

u00B5 - for  micro - µ

u00B2 - for square (x²)

Please refer this for more symbols to use in android application.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2
Solution 3 Mark Stewart