In order to make your app's UI compatible with all the devices like tablets,phones or watches which unit is preferred in android? -


i have used dp in xml. it's not giving me accurate ui.

for sure dp adequat unit accomplish goal. there in addition that, have define several values folders define dimensions scaling tablets or phones. e.g. define 2 values folders like:

values-large values-xlarge 

now define dimen.xml file inside folders, can put measurements in (unit dp) corresponding screensize. define measurement this:

<dimen name="value1">17dp</dimen> 

then embedd sizes in layout xml, like:

android:layout_height="@dimen/value1" 

depending on screensize, system load correct measurements folders, e.g. if have screen size large defined values in folder values-large loaded. more information, have @ https://developer.android.com/distribute/essentials/quality/tablets.html


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -