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. Finishing a GLSurface view activity takes too long..

I'm still a little new to Android programming so you guys might have
to bear with me here.

The app I am working on is based off of the Rokon 2D game engine.
(This is not a Rokon question, just general background information so
please keep reading! :) )

The original idea was to use the 2D game engine to handle the menu,
instructions, and a game board.  We then have a separate activity that
controls a GLSurfaceView which is drawing some .obj objects.  We
wanted to have a 3D feel to this part of the game so this was the best
thing we could think of.

The problem I'm having is that when I call .finish() on the
GLSurfaceView activity, I get a black screen for 3 - 5 seconds while
its trying to clean up the activity.  This is a problem for me because
1.) its annoying to wait that long. and 2.) I have animations
happening as soon as I get a result back from that GLSurfaceView
activity.

This is really weird because my primary activity resumes while the
GLSurfaceView is still finishing up.  So basically I lose my
animations.  I could put in some code to have this automatically wait
5 seconds before doing the animation, however I would like to avoid
that if possible.

This gets even weirder as I don't have this problem on my Samsung
Captivate running Android 2.1, but we get this problem on a Nexus One
using Android 2.2 and I get it on the emulator running 2.3.

Is there some better way to kill an activity?  Or some way to destroy
GL objects before hand so that when we hit the .finish() it doesn't
take as long to clean up?

Any suggestions would be greatly appreciated!

Thanks,

Patrick

-- 

2. Who is checking the state of Activity or Object(like buttons)

To:Android Develpoers
From:JYP
Subject:[android-developers] Who is checking the state of Activity or
Objects(like buttons)
================================================================

Happy new year, everyone~!!!!!!!!!

I ask once more this issue.

Who is checking the state of Activity or Object(like buttons).
(I'm not sure that is correct or not.)

As you know, the selector of Drawable can change images depending on the
states.
Referring this..........

<?xml version="1.0" encoding="utf-8"?>
<selector 
<http://developer.android.com/guide/topics/resources/drawable-resource.html#selector-element>
xmlns:android="http://schemas.android.com/apk/res/android"
    android:constantSize=["true" | "false"]
    android:dither=["true" | "false"]
    android:variablePadding=["true" | "false"] >
    <item 
<http://developer.android.com/guide/topics/resources/drawable-resource.html#item-element>
        android:drawable="@[package:]drawable/*drawable_resource*"
        android:state_pressed=["true" | "false"]
        android:state_focused=["true" | "false"]
        android:state_selected=["true" | "false"]
        android:state_checkable=["true" | "false"]
        android:state_checked=["true" | "false"]
        android:state_enabled=["true" | "false"]
        android:state_window_focused=["true" | "false"] />
</selector>


So, I want to know who is checking the state.
Android OS?
Applications?

Or do I have to check the framework?

What's your opinion?

Thank you for reading....

With kind regards, Yours...

-- 

3. How to read telephone number in handler for Intent Filter intercepting CALL_PRIVILEDGED?

4. Is 9-patch (NinePatch) standard png format?

5. "Stable"socket connection (Correct work with Socket/Thread).

6. Use OpenGL error

7. Convert tickcounts to seconds