NikhilReddy
NikhilReddy

Reputation: 6954

How to declare the layout for 7'inch tablet Android?

I am developing application on both 10'inch&7'inch tablets, here is my problem for 10'inch tablet i have declared layout as(layout-xlarge-land & layout-xlarge-port),while coming to 7'inch i have declared layout as(layout-sw600dp-land&layout-sw600dp-port)?

while coming to 7'inch tablet it's not working for me,The Tablet which i am using is (iRobot).

Upvotes: 21

Views: 24829

Answers (5)

user1010160
user1010160

Reputation: 465

It's because your using a "cheap" (inexpensive) 7-inch tablet 480x800, so it will use sw360 up to 430dp.

Upvotes: 0

Jorgesys
Jorgesys

Reputation: 126455

Android: Tools For Managing Screen Sizes

Kindle Fire: Screen Layout and Resolution

  • phones :

    layout

  • 7” tablets :

    layout-sw600dp

  • 10” tablets :

    layout-sw720dp

  • kindle fire 7" :

    layout-large-mdpi

  • kindle fire 7" HD :

    layout-large-hdpi

Upvotes: 5

zoya ali
zoya ali

Reputation: 400

but if you are building for amazon devices

  • kindle fire 7" uses layout-large-mdpi
  • kindle fire 7" HD uses layout-large-hdpi

along with other android devices 7" which use layout-sw600dp

Upvotes: 6

Labeeb Panampullan
Labeeb Panampullan

Reputation: 34823

you can also specify your layout folder like this

  1. layout-1280x800
  2. layout-port-1280x800

As per new approach discussed here, New Tools For Managing Screen Sizes
we can specify like this

  1. layout For phones
  2. layout-sw600dp # For 7” tablets
  3. layout-sw720dp # For 10” tablets

Upvotes: 8

Uttam
Uttam

Reputation: 12399

In the rare case where you want to further customize your UI, For example for 7” vs. 10” tablets, you can also define smallest widths:

res/layout/main_activity.xml           # For phones
res/layout-sw600dp/main_activity.xml   # For 7” tablets
res/layout-sw720dp/main_activity.xml   # For 10” tablets

and just check out this for 7” vs. 10” tablets:--

New Tools For Managing Screen Sizes.

Upvotes: 57

Related Questions