Screen density & screen layout size

by Chopcsu » Mon, 14 Dec 2009 08:34:51 GMT


Sponsored Links
 Hi,

I am having problems getting Android to use the correct resources.

I am trying to have it pick the correct resources across all densitys
and screen layouts & orientations.

So I have created the directory structure as follows


drawable
drawable-large
drawable-large-land
drawable-large-port
drawable-normal-hdpi
drawable-normal-mdpi
drawable-normal-ldpi
drawable-normal-land-hdpi
drawable-normal-land-mdpi
drawable-normal-land-ldpi
drawable-normal-port-hdpi
drawable-normal-port-mdpi
drawable-normal-port-ldpi
drawable-small
drawable-small-land
drawable-small-port

Since large screen layouts are always hi res screens (480x800,480x848)
and small screen layouts are always lowres(240x320,240x400 etc) i did
not include density descriptions in the directory naming.
And likewise since normal can be low,medium of high resolution
screens, I have included all the different density markers.

I am not sure if android likes me naming the directories like this
since when I load up the normal 320x480 screen,
It is selecting Hi-res resources and down-scaling them. I can see
nowhere in documentation that says this is what it will do so im am
quite confussed as this is what it seems like it is doing.

I am using

 <supports-screens
          android:largeScreens="true"
          android:normalScreens="true"
          android:smallScreens="true"
          android:anyDensity="true" />

Yet I am positive it is resizing the resources automatically for me.
Testing with 2.0 emulators.

When using the WVGA emulators, it uses the hdpi resources unscaled,
when using the 320x480 emulator, it is using the hdpi resources down-
scaled.

Any ideas on where I am going wrong?


--



Other Threads

1. Parsing Dates in other Locales

I need to parse a date using a flexible date format (like "MM/dd/yyyy"
or "dd-MMM"), and so far I've always used SimpleDateFormat for that
(since unfortunately, android.text.format.Time.parse doesn't support
date format strings). This works fine in an US environment, but as
soon as I switch to any other locale, MMM translates into the number
of the month (i.e. it's "6" instead of "Jun"). This seems like a
problem that's new to Cupcake, although I'm not sure.

Is there any way to parse date strings in another locale other than
writing my own parser? android.text.format.DateFormat.format is great
for converting from date to string, but I can't find anything going
the other way around.

-Mike


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

2. Help with Services

Hi all,
              i'm starting an activity that inturn calls a service.... i
wanna get notified when the service competes...
can anyone temme how i can do this???

-- 
Regards,
Sujay
Bette Davis <http://www.brainyquote.com/quotes/authors/b/bette_davis.html>
- "Brought up to respect the conventions, love had to end in marriage.
I'm
afraid it did."

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

3. Screen Brightness

4. emulator rotation on 1.5 with no keyboard on the device

5. xmlbeans support in 1.5

6. Toast without light up

7. SDCard becoming un-writeable