DroidLearner
DroidLearner

Reputation: 2135

How to design for Android Multiple Screens?

1st Image: Default Normal Screen 2nd Image: Galaxy Nexus 4.65" (Eventhough it looks larger, it is under normal screen) 3rd Image: Large Screen

how to design for particular screen size? I mean both 1st and 2nd image comes under 'normal screen'. Suppose If I create new layout folder for Galaxy Nexus (4.65",720x1280) and i was working on it, it affects default layout folder.

Normal Screen Nexus One

Normal Screen Galaxy Nexus

Large Screen

Upvotes: 0

Views: 227

Answers (4)

JRowan
JRowan

Reputation: 7114

Here you go if your looking for something like this, idk, im trying to get some votes im kicked off questions and im stuck, gota get back on this thing

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp
Generalised Dpi values for screens:

ldpi Resources for low-density (ldpi) screens (~120dpi)
mdpi Resources for medium-density (mdpi) screens (~160dpi). (This is the baseline density.)
hdpi Resources for high-density (hdpi) screens (~240dpi).
xhdpi Resources for extra high-density (xhdpi) screens (~320dpi).
Therefore generalised size of your resources (assuming they are full screen):

ldpi
Vertical = 426 * 120 / 160 = 319.5px
Horizontal = 320 * 120 / 160 = 240px
mdpi
Vertical = 470 * 160 / 160 = 470px
Horizontal = 320 * 160 / 160 = 320px
hdpi
Vertical = 640 * 240 / 160 = 960px
Horizontal = 480 * 240 / 160 = 720px
xhdpi
Vertical = 960 * 320 / 160 = 1920px
Horizontal = 720 * 320 / 160 = 1440px

px = dp*dpi/160

Upvotes: 0

Anup Cowkur
Anup Cowkur

Reputation: 20563

Here's my general guide on how to design for different screens:

https://stackoverflow.com/a/12739568/1369222

If you are looking to target only the samsung galaxy nexus, see here:

https://stackoverflow.com/a/9212675/1369222

Upvotes: 2

Monty
Monty

Reputation: 3215

if above solution does not work.try this ,it will surely work ,i have tested this. if you want your app work on different different version of OS. Use these three layout's.

                            For 
                            tablet>3.2 and up verion
                            1-layout-sw600dp


                            For 
                            tablet<3.2 and lower version
                            1-layout-xlarge


                            For 
                            Smart phone
                            1-layout

Upvotes: 2

Monty
Monty

Reputation: 3215

use this link http://developer.android.com/training/multiscreen/screendensities.html

here they provide drawable (if you want to use image) for each screen with the same image ,your device automatically choose their own pic according to their density.

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

and this is for layout ,make new folder in your res folder and give name it layout-large and put same xml file in this i.e main.xml.

res/
        layout/
            main.xml
        layout-large/
            main.xml

Upvotes: 0

Related Questions