Search code examples
javaandroidxmlscreen-size

multiple screen size issue


Base on my understanding, The supporting multiple screen size is work on 3.2 or later. any below of that version, it will not auto detect screen size and choose the correct layout folder.

Correct me if i am wrong

However, my case was i am running an application on an emulator and two difference size and version devices.

Emulator : 1.6 version with QVGA. It does auto detect screen size and choose correct layout folder.

first device : 2.2 version with small size (QVGA). It does not auto detect screen size and choose wrong layout folder

second device : 4.0.4 version with Nexus S-medium size (HVGA). It does auto detect screen size and choose correct layout folder.

my manifest.xml

<uses-sdk android:minSdkVersion="12" />

<supports-screens
    android:anyDensity="true"
    android:largeScreens="true"
    android:normalScreens="true"
    android:resizeable="true"
    android:smallScreens="true"
    android:xlargeScreens="true"
    android:requiresSmallestWidthDp="426" >
</supports-screens>

my folder

res/drawable

res/layout

res/layout-small

I don't create new set of drawable because the image can show clearly if using small layout so i don't bother that one.

What if i upgrade my first device from 2.2 to 3.2 or later, then the device will auto detect and choose correct folder?


Solution

  • The below link will guide you on how to go about with it.

    http://www.brighthub.com/mobile/google-android/articles/61895.aspx#