Why do I need a different dimension file for different screen sizes?
Consider a case where I have two devices : A phone and a tablet. I create a view using 'dp' for specifying the sizes. Now, why does it not appear the same in both cases as dp is calculates the pixel value depending upon density. Is the pixel size same for every device, eg. TV or phone or tablet. If no, then dp should work for all the devices with same value. There should not be need to give the specs in a separate xml file.
What you say is correct. If you use dp to define the view sizes of elements such as LinearLayout, ImageView, etc, etc, you will get similar aspect in every device. That is becuause the size of the pixel is going to be scaled properly depending on each device pixel density. But, the thing is that not every device has the same aspect ratio. This is, you may use a xml layout file for general smpartphones and everything is going to be allright (almost) but if you use the same xml file for a tablet it will look rather funny. And that is because the screen is much wider than a smartphone, so your layout need to be "rethinked". The elements has been correctly reescaled but they dont fit good in a very diferent screen like a TV or a tablet. That is because there are a lot of pixels more that need to be filled with view elements.
Is Android Widget ID persistent
Right to Left support for TextView in Android
Android detecting on touch inside fragment
How to Prevent an Alert Dialog Getting Closed by Back Button
Emulator of specific device
how to make application with android
Exit Button on App? App Still Running?
Set the background colour of a Layout view to a gradient in Android?
How to display data between two dates based on android spinners selected item from sqlite db?
How to programmatically draw smooth stroke around a button in Android?
How to kill app on button press
How to Pass Class to ImageSwitcher in Android?
High-performance bitmap drawing from Webview
ContentObserver for Camera Button?
Easiest secure Android server backend
Android: Debug vs. Release (SDK) performance