user346443
user346443

Reputation: 4862

Android Multiple Screen Resolutions

I've created a android layout that looks fine on my Galaxy s2 (480×800) device. I want to support a layout for and Galaxy s3 (720x1280) so i created a AVD with those specs, then copied the res/layout directory and contents to two other directories: res/layout, res/layout-large and res/layout-xlarge. To test that the layouts were working positioned a test button at parent-center in res/layout, parent-left in res/layout-large and parent-right in res/layout-xlarge. If i run the application on my device (480×800) or in the AVD (720x1280) the test button is always at parent-center. Why isn't the test button positioned by the values specified in res/layout-large or res/layout-xlarge.

My manifest is as follows:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10" />

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

I am targeting 2.3.3 and have also cleaned my build before testing

Im seriously going mad so any help would be appreciated.

Upvotes: 2

Views: 698

Answers (1)

kabuko
kabuko

Reputation: 36302

I don't believe the Galaxy S3 is a "large" screen. Small/normal/large/xlarge refer to physical size, not pixels. You need a combination of screen density and screen size to target different devices. Read the Android guides and training for more details on this.

Upvotes: 1

Related Questions