1. Check out our companion app, Forums for Android! Download from Google Play

Screen Sizes..?

Discussion in 'Application Development' started by Griffolion, Apr 26, 2011.

  1. Griffolion

    Griffolion Member
    Thread Starter
    25

    Apr 26, 2011
    9
    0
    25
    Business Development in a Training Company
    England
    Hi everyone,

    I was just wondering how you go about developing your app for different screen sizes. My first reaction was that you would have to develop a layout for each activity for each screen size/resolution you wanted to support, however i get the feeling it should be a little simpler than that.

    So the layout for my app is called Main.xml and it's set up optimally for a 800x480 4.3" screen, what do i have to do to make the layout okay for different densities etc?

    Do you work on the same XML layout for all your sizes or what? It confused me a little.
     

    Advertisement

  2. JiMMaR

    JiMMaR Well-Known Member
    53

    Jun 12, 2010
    363
    57
    53
    you probably should use the different layouts that android provides to make your layout general , as if you assigned a button to be stuck to the top of the screen and fill_parent width , it'll fill the width of the screen regardless of the resolution

    and never use absolute layout , it's officially deprecated
     
  3. kikloo

    kikloo Member
    16

    Jul 14, 2010
    19
    6
    16
    Chandigarh, India
    Hi,

    I am using Basic4Android and my development has stopped due the exactly same question. I am not sure how to handle different screen sizes ? :( Devs. are making apps like anything and I think it should be much simpler to handle different screen sizes but I am not sure how to do it :(

    Thanks.
     
  4. mrichards957

    mrichards957 Member
    26

    Nov 15, 2012
    6
    1
    26
    Male
    Software Developer
    Littleton, CO
    You've probably seen these, but here are the official docs on the subject:

    Supporting Multiple Screens | Android Developers
    Designing for Multiple Screens | Android Developers

    Sometimes I make different layouts for portrait and landscape (in res/layout and res/layout-land), but generally I try to stick with one layout that scales to different resolutions. I target an 800x480 screen, and then test at a couple higher and lower resolutions. Android will drive you crazy if you try to target every possible screen size.
     

Share This Page

Loading...