Skip to main content

Difference between px, dp, dip and sp in Android


Main Difference Between px,sp,dip is
  • px is one pixel.
  • sp is scale-independent pixels.
  • dip is Density-independent pixels. 

                 

                    1> sp for font size     
             2>dip for everything else
                          3>dip==dp

Comments

Post a Comment

Popular posts from this blog

Create Shared Prefrence Via XML In Android

Download Source Code : Click Here Output:

Sandeep Maheshwari on zee news

Network Security Exception in Android Retrofit Cleartext HTTP traffic not permitted

Create One directory in res/xml Create file in xml directory Past give below code : < network-security-config > < base-config cleartextTrafficPermitted= "true" /> < domain-config > < domain includeSubdomains= "true" >www.xyz.com</ domain >> < trust-anchors > < certificates src= "system" /> </ trust-anchors > </ domain-config > </ network-security-config > Add one Line into AndroidMenifest.xm File in application tag : android :networkSecurityConfig= "@xml/yourfilename" android :usesCleartextTraffic= "true"