Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which layout is suitable for all Android mobile?

I am developing one application, right now i am on designing phase. i design one screen
on the 3.7WVGA(Nexus One) screen in eclipse using Linear Layout. but when i test it on 2.7
my some icon are go outside of the screen. my question is that which layout is suitable for all screen whether i design it in 3.7 inch or run it on 2.7.
Please give me a suggestion.
Thanks in Advance.
I design it in 3.7

it look like in 2.7

1st i design it in 3.7 and second in 2.7.

like image 510
Sandip Armal Patil Avatar asked Feb 20 '26 22:02

Sandip Armal Patil


2 Answers

Don't ever, ever, ever design a screen for Android based on an actual screen size. You will always screw yourself up because there are a hundred different screens out there. What looks good on one phone will look like crap on another. That being said, here are some tips:

  • Use RelativeLayout to lay your button contents out. Once you understand the model it's much easier than you suspect and it will make it easy to automatically scale things.

  • Only use actual pixel sizes for things that "float". You never want to specify the width of something and try to fill the width of the screen.

  • Include multiple resolutions of your images. Let the system pick the right resolution for you.

  • A table/grid layout will make things easier for you on the overall design.

  • Big panels of buttons are played out. There are other UI options at your disposal (menu buttons, swiping left and right through screens, etc.). When users see a field of buttons it looks like the app was slapped together.

like image 60
Hounshell Avatar answered Feb 24 '26 17:02

Hounshell


For that kind of layout use GridView if you want it scrollable, or a simple RelativeLayout if you want all the elements to scale depending on the size of the screen (use toRightOf, toLeftOf, above, below and weight to achieve that)

like image 24
zrgiu Avatar answered Feb 24 '26 17:02

zrgiu