Unclear on how sp works exactly (scaled pixels)

android, android-layout

Solution

text rendered with sp is more compatible with accessibility options, for example if the users enables a high contrast mode or universally increases the size of text. Since sp is also density independent, that is the only difference between sp and dp.

Problem

Possible Duplicate: Difference of px, dp, dip and sp in Android? So I know I should use `sp` only for text font sizes. Now, what I don't understand is what they do exactly. Let's say I have the following attribute for a `TextView` in a layout for a normal screen size: ``` android:textSize="17dp" ``` If I replace it with this: ``` android:textSize="17sp" ``` What happens? In the visual editor, it doesn't look any different? I am guessing that if I have, say a 3.2" screen which qualifies for the normal size layout, and a 4.0" screen which also qualifies for my normal size layout, then if I use `sp`, the text's size will be slightly scaled up? Is that right?

Original source

Related problems