Well, it looks like you have already discovered why the two have differences because they report different factors of density density:
- Nexus 7: TVDPI: Scale factor = 1.333
- Kindle Fire HD: HDPI: zoom ratio = 1.5
So why do they report differently when they technically have the same physical size and resolution?
The CORE problem actually exists because one device is a Google Play device (Nexus) and the other is not (Kindle). All Android devices that have Google Play (and other Google applications) can do this by passing something called the compatibility test suite (CTS), which verifies that settings like this comply with the standards they set out. The standards themselves are documented in a compatibility definition document (CDD) for each version. Here is the link to the CDD for Android 4.0 (section 7.1 is devoted to screen size and screen density). CDD tells the device manufacturer that they should report a scale factor that is numerically closest to the actual DPI of the screen, which is actually TVDPI in this case.
Amazon devices do not use Google applications, including Google Play. Although they may be in their own interests following the same standards, they are not bound by them, and are often not respected. TVDPI pounced on everyone when it appeared on Nexus 7, but Amazon would have found out if they referenced CDDs during design.
How does this make them behave differently?
The differences are not in the choice of layout. Obviously, from your screenshots, both devices pick the correct layout as you expect. Changing the sw value in the layout directory only affects which devices will select this layout ... it doesn't change anything about how everything will scale. Don't bother trying to place layouts by themselves in density-specific directories ... layouts should be flexible.
Instead, the problem is calculating the size or size performed on density-independent pixel units (e.g. dip or dp), such as text sizes, any fixed sizes you could create, and acceptable sizes.
Since the two devices have different options for scaling assets, any resource you use or any value you specify in "dp" will result in a small change. Let me give you two examples:
You define the text size for TextView as 16dp . On Nexus 7, this will draw text at 21px. Kindle Fire HD will draw the same text in 24px. The difference is small ... but it exists.
The same is true for hand-drawn images. If you only defined the image in drawable-mdpi at 48x48 and the same image in drawable-hdpi at 72x72, the Kindle has a 72px image that will be used directly, and Nexus will create a 64-pixel scale image, so there is an 8 pixel difference between the two assets.
What can I do to make two similar images more similar?
In most cases, I would say that itโs not worth it. As a rule, scaling does not significantly affect the result of the application, if the layout restrictions are not configured with too many hard-coded sizes.
However, in general, if there are parts of your user interface that you need to specifically modify for this purpose, the solution is to determine the specific resources and sizes for the -tvdpi case where you think they are needed (again, I would 't recommend scaling EVERYTHING in your application to suit this case).
For things like text or view sizes, this means you might need the values-tvdpi/dimensions.xml file and the default values/dimensions.xml file. Using the above example, you can define the default text size as 16dp, but in the -tvdpi location -tvdpi specify the same dimension as 18dp. This will cause both devices to scale the final text to 24 pixels. In code that uses the actual dimension, specify it as @dimen/myTextSize , not 16dp .
For the dropdowns, add the drawable-tvdpi and scale these assets to fit what you think they should draw on devices like Nexus 7. Again, in our previous example, copy the same image file from the drawable-hdpi in the drawable-tvdpi folder so that both devices draw the same image at 72px.
To avoid copying the same asset in multiple places, you can also do this with aliases. Put the image in drawable/ with a special name and use values-tvdpi/drawables.xml and values-hdpi/drawables.xml to link to one asset in two places. For more information about aliasing, see this documentation . Examples are for layouts, but the same paradigm works with drawings (or any resource), changing to type="drawable" .