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. education / university programs - android devices?

Hello,
We would like to use the Android platform for new university lectures
for "mobile programming"
- does Google somehow support these activities by giving development
devices or discounts for educational institutions?
Mobile technology will be focused here by many courses in the near
future. Having limited financial resources,
support by hardware providers would greatly help pushing forward this
technology in our school.

Thanks,

Oliver Lietz

Beuth University for applied sciences
http://www.beuth-university.de/

Multimedia and Mobile Technology
http://www.nanocosmos.de/lietz

-- 

2. Tutorial Help --

HelloItemizedOverlay.java
HelloGoogleApps.java

Does someone have a finalized version of the above-mentioned java
files?  The files are from the Android Tutori{*filter*}entitled "Hello,
Views" >> "Hello Google Maps".   While the tutorial is helpful it
starts moving quickly in "Part 2: Adding Overlay Items," and I am
having trouble understanding where to put the classes and methods in
relation to each other.  I'd like to see a finished product of each
java file so I can find what I did wrong.
You could probably even just copy/paste the contents of the java file
into this forum, because neither file is very lengthy.
I'd greatly appreciate it.  Sorry for such a rookie request--the
tutorials are supposed to be so easy and well-explained that the java
files are not even needed.  I'm an amateur, but I'm determined to
create my own android app.

Thanks!

(Note

-- 

3. WebView HTML5 Cache Manifest

4. SQLite database locale, locking, and version

5. Access To the SIM CARD

6. How to use 3G Connection in Android Application instead of Wi-fi?

7. Horizontal scroll in ListView