How do developers work with different screen sizes ?

  • Replies:4
  • OpenNot stickiedUnanswered

Nov 29, 2012 11:01:35 AM

Hi,

Recently I started to learn Android Development and I am stuck on how to change the layout according to the screen size ?

My thoughts are:

1. Do devs. create different screens for different sizes ?
2. Do devs. create different versions of same app. for different sizes ?
3. Android/Java takes care of the size itself and dev. has nothing to do about it ?

Please tell me, my learning curve is really stuck on this part.

Thanks.

Nov 29, 2012 4:52:13 PM

Hi,

I am using Basic4android for my android developement.
It generates native Android applications and has a powerful designer scripts feature that
let us to easily create sophisticated layouts for multiple screen size (using scripts).

Enjoy,
WW

Dec 14, 2012 6:21:26 PM

I developed PhotoDream its avaliable at market.
Kikloo

1. Do devs. create different screens for different sizes ?
I you see it int the left, that buttons which are my tooning small yorkie,
are four different sizes drawable-ldpi 36 height,drawable-mdpi 48 height,drawable-hdpi 72height,drawable-xhdpi 96 height,
Kikloo

2. Do devs. create different versions of same app. for different sizes ?
Not necessary, but it can be an option. It is better to create different layouts for different screensizes
Kikloo

3. Android/Java takes care of the size itself and dev. has nothing to do about it ?
No, android tries to fit, but will look horrible.

Feb 4, 2013 10:19:58 AM

You can develop different screen sizes with single project.By Creating different folder under res folder

layout-small
layout-long
layout-large
layout-xlarge

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

By this you can create separate xml for different layout,inorder the application to be suitable for various devices.

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

Note: These minimum screen sizes were not as well defined prior to Android 3.0, so you may encounter some devices that are mis-classified between normal and large. These are also based on the physical resolution of the screen, so may vary across devices—for example a 1024x720 tablet with a system bar actually has a bit less space available to the application due to it being used by the system bar.

Feb 4, 2013 12:17:01 PM

Download the latest S.D.K. updates from google. It will give the all the sizes available for tablets. For Device i think you can use table layout with weight properties. it will draw the ui as per the screen.