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.

On Thu, Mar 5, 2009 at 10:57 AM, Avraham Serour <[email protected]> wrote:
> 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
>
> On Thu, Mar 5, 2009 at 8:53 PM, Videoguy <[email protected]> wrote:
>>
>> Hi
>> I am working on a screen that needs to look fine at HVGA-L resolution
>> as well as 640x480 resolution. Lets say I have a button that is 200
>> pixels wide and 50 pixels high on HVGA-L skin. When the same layout
>> xml is shown at 640x480 skin, I want my button size increase
>> proportionately. The hardware the app runs on supports both the
>> resolutions.
>>
>> How do I do that?
>>
>> None of the units that the android framework provides seems to have
>> this facility. If I use px, then the button size will stay same. dip
>> doesn't matter because it is the same hardware. sp is meant for fonts,
>> not for button width/heights.
>>
>> Is there any trick to do this?
>>
>> Thanks
>> Videoguy
>>
>>
>
>
> >
>



-- 
Romain Guy
Android framework engineer
[email protected]

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to