Converting Between SP/EM and DP/PX

Convert Android's SP to EM

sp = em
The formula for converting sp to em seems to be:
sp * 0.0624 = em

Convert Android's DP to PX

Pretty simple:
1dp = 1px

When Should I Use px/dp vs em/sp?

Use px/dp for defining precise visual elements such as padding, border, margin, and sometimes image sizes.

Use em/sp for defining font and icon sizes so that your app respects the users' font-size preferences.