Android, mdpi density, but different screens

I am working on an application that will run on multiple devices. I have three devices for testing.

HTC Desire S - 480 x 800 pixels, 3.7 inches (~ 252 pixels in pixels)

Samsung P6200 Galaxy Tab 7.0 Plus - 600 x 1024 pixels, 7.0 inches (Pixel density ~ 170 pixels)

Samsung Galaxy Tab 2 10.1 P5100 - 800 x 1280 pixels, 10.1 inches (Pixel density ~ 149 pp)

According to my understanding, if I correctly develop my application for the above three, most other devices will be processed. may be?

My question is: where should I start creating my images? Since both tablets have a mdpi density, but different screen sizes, I developed images for TAB2 and placed the images in the drawable-mdpi , these images were perfectly shown on TAB2, but on TAB7 everything is confused, the images overlap.

So, both tables are mdpi , and for mdpi images should be placed in drawable-mdpi , but for what tablet size should I design the images?

+4
source share
2 answers

The user interface of an application is usually not completely raster. You have some elements, such as fixed-size icons, but then again your buttons should scale without any problems. Therefore, assuming that you want to target all devices, you should design your interface as it fits on the smallest screen (in this case, 600 x 1024 pixels is your maximum) - this means that if you view the specified screen all the elements the user interface is fully consistent with the screen. On higher screens, the user interface should scale, but usually it does not require a special approach (if you are not working in a raster game, for example), since elements such as lists, buttons, layouts will be stretched automatically. And if your project involves any bitmap images associated with the specified scalable elements, use 9-patch PNG to make it properly scaled.

Read more about this in the " Support for multiple screens ."

+3
source

I recommend you design for xhdpi, you can always resize for lower dpis.

Take into account that dpi is not related to screen size, on the other hand, on large tablets, the screen has less dpi than most "modern" phones.

Make a layout for the size of the target screen, that is, 10 "and 7" tablets, the system will take the best bitmap for your dpis device (or close the closest!).

With the latest (beta) Android SDK and the Eclipse plugin, you can better understand the screens of different devices: dpi resolution + pixel + screen size. Now they show that for exaple, for example

 7" WSXVG (Tablet) (1024x600: mdpi) 

in the layout editor.

+1
source

Source: https://habr.com/ru/post/1441120/


All Articles