0

I have few doubts.I am developing the project from the scratch.Whether I need to maintain all the drawable folders like

-drawable-ldpi
-drawable-mdpi 
-drawable-hdpi
-drawable-xhdpi
-drawable-xxhdpi
-drawable-xxxhdpi

or I can use these folders

-drawable-xhdpi
-drawable-xxhdpi
-drawable-xxxhdpi.

Because If I use all the drawable screen size my apk size is increasing.I think currently ldpi,mdpi and hdpi screen size is not in market.So I am planning to omit ldpi,mdpi and hdpi. Please share me your suggestions.

Deep Patel
  • 2,584
  • 2
  • 15
  • 28
Hema
  • 37
  • 9
  • https://stackoverflow.com/questions/6166677/android-screen-size-hdpi-ldpi-mdpi – Ankit Apr 05 '18 at 06:54
  • I am planning to go with xhdpi,xxhdpi and xxxhdpi or its a mandatory to use all screen sizes. – Hema Apr 05 '18 at 06:59
  • actually its depends on you. If you are targeting small screen size than it is required otherwise no requirement. Test your app with different screen size phones. Basically hdpi, xhdpi, xxhdpi are enough and for more info try this https://developer.android.com/guide/practices/screens-distribution.html – Ankit Apr 05 '18 at 07:06
  • okay thanks for your suggestion. – Hema Apr 05 '18 at 07:19

2 Answers2

0

Please refer to this DOCUMENTATION and also this link

+----------------+----------------+---------------+-------------------------------+
| Density Bucket | Screen Density | Physical Size | Pixel Size                    | 
+----------------+----------------+---------------+-------------------------------+
| ldpi           | 120 dpi        | 0.5 x 0.5 in  | 0.5 in * 120 dpi = 60x60 px   | 
+----------------+----------------+---------------+-------------------------------+
| mdpi           | 160 dpi        | 0.5 x 0.5 in  | 0.5 in * 160 dpi = 80x80 px   | 
+----------------+----------------+---------------+-------------------------------+
| hdpi           | 240 dpi        | 0.5 x 0.5 in  | 0.5 in * 240 dpi = 120x120 px | 
+----------------+----------------+---------------+-------------------------------+
| xhdpi          | 320 dpi        | 0.5 x 0.5 in  | 0.5 in * 320 dpi = 160x160 px | 
+----------------+----------------+---------------+-------------------------------+
| xxhdpi         | 480 dpi        | 0.5 x 0.5 in  | 0.5 in * 480 dpi = 240x240 px | 
+----------------+----------------+---------------+-------------------------------+
| xxxhdpi        | 640 dpi        | 0.5 x 0.5 in  | 0.5 in * 640 dpi = 320x320 px | 
+----------------+----------------+---------------+-------------------------------+

Also if you are worried about increased APK size due to this, you can use vector drawables.

Please refer this Link for understanding vector drawables

Deep Patel
  • 2,584
  • 2
  • 15
  • 28
-1

Screen sizes for android::

Dimensions:-

LDPI: Portrait: 200x320px Landscape: 320x200px

MDPI: Portrait: 320x480px Landscape: 480x320px

HDPI: Portrait: 480x800px Landscape: 800x480px

XHDPI: Portrait: 720px1280px Landscape: 1280x720px

XXHDPI: Portrait: 960px1600px Landscape: 1600x960px

XXXHDPI: Portrait: 1280px1920px Landscape: 1920x1280px

Chintan Joshi
  • 1,207
  • 1
  • 9
  • 17
  • The density is independent of screen size. Dpi is the amount of pixels per inch, meaning 1080x1920 can be XXXHDPI on a small device, but XHDPI on a bigger device (bigger = bigger physical screen) – Zoe Apr 05 '18 at 07:19
  • There is nothing mention in question about desnsity. That's why Answer contains information about SCREEN SIZE for devices of all different sizes ldpi, mdpi, hdpi, xhdpi, xxhdpi & xxxhdpi either in portrait or landscape. – Chintan Joshi Apr 05 '18 at 07:22
  • The screen size buckets are defined through the density of the screen, not the actual screen size – Zoe Apr 05 '18 at 07:23
  • That's why I added in px when you missed it. – Chintan Joshi Apr 05 '18 at 07:24
  • And also drawables are made in px. – Chintan Joshi Apr 05 '18 at 07:25
  • ***The screen size classes are independent of pixels***. Of course drawables are made in pixels because dp is an Android-specific unit that converts to pixels based on the density of the device. The screen sizes (MDPI, HDPI, etc) are defined by the density. XXXHDPI has a very high pixel density, where as LDPI has a very low pixel density. The actual amount of pixels the device has doesn't define the classes; it's the pixel density that matters here – Zoe Apr 05 '18 at 07:27