0

I got so confused after reading the documentation. I've designed my app to run on small, normal and large screens. my question is: how to prevent my app from being stretched when running on tablets? on other words: I want

the system to draw the application's layout the same as it would on a normal size handset (emulating a 320dp x 480dp screen), with a black border that fills the remaining area of the screen.

as mentioned in the documentation. thank you.

a fair player
  • 11,530
  • 9
  • 46
  • 48
  • 1
    its not possible unless you make such a layout, i would recommend u too add larger images to fit tablet view. if u want i can help u, i reacentely completed my application working perfectly in all android devices. – Maulik J Jan 23 '12 at 16:14
  • try this http://stackoverflow.com/questions/7199492/what-are-the-aspect-ratios-for-all-android-phone-and-tablet-devices – Maulik J Jan 23 '12 at 16:27
  • note also that as of 3.1 or 3.2 (I forget which) the user gets the option to stretch your app to make it fit their screen. So even if your layout defaults to being shrunken and centered they'll have the ability to stretch it. And AFAIK it is not possible to prevent the OS from allowing the user to do so. – FoamyGuy Jan 23 '12 at 16:29
  • @MaulikJ thank you for your supportive spirit. – a fair player Jan 24 '12 at 08:09
  • @Tim I know that they have the ability to do so but if they find it not pleasant experience they will roll back .. thank you for taking time to help me. – a fair player Jan 24 '12 at 08:09

1 Answers1

2

You could possibly create a layout for xlarge screens which contains a RelativeLayout with a black background. In this RelativeLayout import your current layout (see the <include> tag), and position it in the location your require, also set the android:layout_width and android:layout_height in your include tag to 320dp and 480dp, this should force it to keep its size.

I think this should roughly do what you need.

Kingamajick
  • 2,281
  • 1
  • 16
  • 19
  • your answer looks very creative to me and it's a good example of thinking out of the box. it's not what i'm looking for but it'll be one of my last resorts. I was looking for doing it through the tag ... well, I guess I'll go through the documentation once again. – a fair player Jan 24 '12 at 08:15