Looking for a way to build resolution independent layout xml?

by Avraham Serour » Fri, 06 Mar 2009 02:57:51 GMT


Sponsored Links
 build the interface without the xml, coding it, so each time you are going
to draw it check current resolution.
I worked with brew a few years back and some things we did that way, others
we just draw the button the same size in pixels, so the owner of the bigger
screen would see things smaller or had more unused screen area





--~--~---------~--~----~------------~-------~--~----~



Looking for a way to build resolution independent layout xml?

by Romain Guy » Fri, 06 Mar 2009 08:01:03 GMT


 No, that is NOT the correct way to do it.

The XML layout files contain everything you need to easily support
different screen densities. First of all, define all dimensions using
fill_parent/wrap_content or the dip unit. For instance, instead of
layout_width="10px" use "10dip". Also, you can create resource
directories that are configuration dependent: drawable-320x240/ or
drawable-120dpi/.

The current versions of Android (1.0 and 1.1) let you use these
features but they are not interpreted correctly. Cupcake however
correctly transforms the dip unit into pixels and lets you use the
XXXdpi resource directories.







-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Looking for a way to build resolution independent layout xml?

by Dianne Hackborn » Fri, 06 Mar 2009 08:12:38 GMT


 




But Cupcake does -not- introduce platform support for anything besides HVGA;
official support will be coming after Cupcake.  This is just another step on
the road to getting there.

Just to be clear. :)

-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Looking for a way to build resolution independent layout xml?

by Dianne Hackborn » Fri, 06 Mar 2009 08:13:47 GMT


 Oh and it's probably worth saying, definitely before cupcake it just isn't
worth trying to run the emulator in anything besides the normal HVGA
resolution.  No other resolutions are supported, and trying to make them
work is really just going to be sending you off in the wrong direction
working around things in the platform that just aren't there.








-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~



Looking for a way to build resolution independent layout xml?

by Romain Guy » Fri, 06 Mar 2009 08:16:54 GMT


 Yes, that's correct I should have been clear about that, sorry.








-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. apakah ada yg tahu, kapan Samsung Galaxy GIO dijual di Indonesia ?

Rekan rekan, saya mau tanya : apakah ada yg tahu, kapan Samsung Galaxy GIO
dijual di Indonesia ?

terima kasih

-- 
===============

2. Hp android yg kuat buat pes 2011

mandroid luv luv triple l

-- 
===============

3. Is there any way to know Canvas is using hardware scaling or not?

4. [WTI] Motorola Xoom Overclock to 1.5Ghz, hasil nya ?

5. help suhu, suhi n teman android

6. Mohon Maaf ...

7. Galaxy TAB - GPS gak bisa lock (SOLVE)