and
and

Reputation: 351

Supporting different screens, based on the dimension or based on the dpi?

I use API 7. I know there are two ways for my question:

1- using the layout-small and layout-normal and layout-large and layout-xlarge.

2- using the sw-320dpi and like this.

When I see the all existing devices (tablet and phones) in the android studio, I understand it does not contain the all existing devices (tablet and phones) in marketplaces. Now I want know your experience about my question. If you want create an application that it uses the API 7, Which method you choose? I do not want link from other websites, I want know your experience about supporting different screens? What is the best way?

Upvotes: 1

Views: 47

Answers (2)

felli mohamed hedi
felli mohamed hedi

Reputation: 309

you use api level 7 so you should use :

layout-small, layout-normal, layout-large and layout-xlarge. because using sw-320dp ... begins with android 3.2(api level 13)

Take a look :

Beginning with Android 3.2 (API level 13), the above size groups are deprecated and you should instead use the swdp configuration qualifier to define the smallest available width required by your layout resources. For example, if your multi-pane tablet layout requires at least 600dp of screen width, you should place it in layout-sw600dp/. Using the new techniques for declaring layout resources is discussed further in the section about Declaring Tablet Layouts for Android 3.2.

http://developer.android.com/guide/practices/screens_support.html

Upvotes: 2

Natix
Natix

Reputation: 14257

It's not sw320dpi, but sw320dp. This number doesn't represent screen density, but size in the same manner as small/normal etc.

See http://developer.android.com/guide/practices/screens_support.html

  • xlarge screens are at least 960dp x 720dp
  • large screens are at least 640dp x 480dp
  • normal screens are at least 470dp x 320dp
  • small screens are at least 426dp x 320dp

Upvotes: 0

Related Questions