What is the difference between px sp dp dip in android
Full form of Px, Sp, Dp, Dip, Pt, Mm, in dimension.
Dimensions values are defined inside android layout.xml file for example 10sp, 20dp, 100px etc. There are basically six types of dimension are available to develop android applications and each and every dimension represent a unique set of size to define specific area on android mobile screen. So here is the complete step by step tutorial for What is the difference between px sp dp dip in android.
What is the difference between px sp dp dip in android.
- dp : Full form of dp is density-independent pixel. dp is a type of abstract unit based upon physical density size of android mobile screen. According to Google android developers 1dp is mostly equal to 1 px.
- dpi : Full form of dpi is Dot per inch.
- sp : Full form of sp is Scale independent pixel. sp is mostly used to scale android applications font size. Sp is recommended to used to declare application font sizes.
- pt : Full form of pt is Points represents 1/72 of inch based upon android mobile phone screen.
- px : Full form of px is pixels are represents each and every pixel of real screen. The screen can be anyone’s device like TV, computer, Led, LCD etc.
- mm : Full form of mm is Millimetres based upon device screen size.
- in : Full form of in is Inches based upon real device screen size.