pavan
pavan

Reputation: 3

Different display resolutions on android phones

how an application could make sure that it looks good on any mobile Android phone (there are several manufacturers, and each phone has slightly different specifications).

Upvotes: 0

Views: 823

Answers (3)

Anju
Anju

Reputation: 9479

You may refer to the below link: http://developer.android.com/guide/practices/screens_support.html

For eg: if you have to show an image in ur appn, then that image should be kept inside 3 folders \drawable-hdpi, \drawable-ldpi, \drawable-mdpi with the same name but with different sizes. And you can refer that image by just telling the name. Android will automatically take the image from any one of the folder according to ur mobile.

Likewise dont keep values as pixels. Instead of that give dip or dp.

For more reference you may refer the above link.

Upvotes: 0

Piyush
Piyush

Reputation: 2609

For Apps that looks good in any android phone, you must create your apps that support multiple screen resolution.for that you can use:

res/layout/main.xml // layout for normal screen size
res/layout-small/main.xml // layout for small screen size
res/layout-large/main.xml // layout for large screen size

and your images for different screen should be ::

res/drawable-ldpi/.png // image for low density
res/drawable-mdpi/dpi/
.png // for medium density
res/drawable-hdpi/*.png // image for high density

for more details visit:-->http://developer.android.com/guide/practices/screens_support.html

Upvotes: 0

Daniel
Daniel

Reputation: 185

There are 3 different screen sizes. So you create 3 folders named like that:

res/drawable-ldpi/my_icon.png       // icon image for low density
res/drawable-mdpi/dpi/my_icon.png   // icon for medium density
res/drawable-hdpi/my_icon.png       // icon image for high density

And put for each screen-size the right images. Also possible with layouts:

res/layout/my_layout.xml            // layout for normal screen size
res/layout-small/my_layout.xml      // layout for small screen size
res/layout-large/my_layout.xml      // layout for large screen size

http://developer.android.com/guide/practices/screens_support.html

Upvotes: 3

Related Questions