Skip to content Skip to sidebar Skip to footer

Supporting Different Screens

im working on Supporting different Screen for android i created different drawable folders and pasted pics according to their requirments like as bellow drawable-ldpi = 240*320 px

Solution 1:

Android OS automatically selects drawable from specific folder. You as a developer must only provide different drawable for each folder:

drawable-xhdpi/
     awesomeimage.png
drawable-hdpi/
        awesomeimage.png
drawable-mdpi/
        awesomeimage.png
drawable-ldpi/
        awesomeimage.png

The best way to show that it works is to launch your application on real device. You can also use different devices in Android Studio in designer and pictures from different drawable folders should be applied:

enter image description here

Hope it helped.

Solution 2:

-ldpi, -mdpi, -hdpi, -xhdpi relative to resolution and -small, -normal relative to size, -land relative to oriention of device. You can change to:

layout-ldpi, 
layout-mdpi, 
layout-hdpi, 
layout-xhdpi

to them select (Order)

drawable-ldpi = 240*320 px (dimension)
drawable-mdpi = 320*480px
drawable-hdpi = 480 * 800px
drawable-xhdpi=720*1280px

Solution 3:

It selects layout based on the device. It selects only one layout per device. For example, a phone with 4.5 in screen , it selects normal layout, and for tablets it selects large layout.

These folders are for different devices with different screen sizes and resolution.

As you want all the images to display. You just cant because you device is static in screen size and resolution.

Save all the images in each folders you'll get all the images. This too gets displayed from one folder.

You gotta read developer site to understand better

Post a Comment for "Supporting Different Screens"