In the xhdpi density range
There are multiple resolution devices
like Nexus 7 with 1200 X 1920 pixel resolution which comes under xhdpi and Nexus 9 with 2048 X 1536 pixel resolution which also comes under xhdpi
samsung galexy note pro has 2560 x 1600 pixel resolution which also comes under xhdpi density
So if i design with 1200 X 1920 and place assets values in dimens-xhdpi then it wont fit for 2048 X 1920 or 2560 x 1600 resolution devices how can we make it compatible for all
I didn't really understand how to make it compatible Reading the developers documentation, if somebody could explain that would be so helpful
Screen density and screen size are two different things. On Android you have to primarily design for densities not for screen sizes. Screen sizes are supported only in a limited fashion.
Basically, you shouldn't assume set of specific widths and heights of the screen and the programmer shouldn't hardcode any pixel values in code or resources. Android runs on a huge variety of devices so it's impossible to target specific sizes.
Designers for Android typically design some standard screen size. But they know it won't look exactly like it on most of the phones. They design it so it can stretch and/or scroll. They count from start that when the screen is smaller it will e.g. scroll and when the screen is bigger there will be bigger spaces in between the views.
To further work around screen size differences, Android offers handling via ranges of screen sizes. You can either use old screen size resource qualifiers (
small,normal,large,xlarge) or newersw<N>dp,w<N>dp,h<N>dp. You can combine those qualifiers with the density qualifiers (e.g.-large-xhdpior-sw640dp-xhdpi). This is the way phones and tables are supported in one app.You can find more info about resource qualifiers in the documentation here and here.