0

I am developing an Android application intended for high end handset devices like Galaxy S3, Galaxy Nexus, Xperia V etc. Now I want to know which layout is suitable for devices with resolution 720x1280, density xhdpi and size normal.

I already tried layout-xhdpi-1280x720 and Galaxy S3 device is loading screens from here, but not Galaxy Nexus.

I have tried layout-sw260dp but Galaxy Nexus emulator do not loading screens. Also Nexus7 is emulator is loading from here. I don't want any tablet to run my app.

What can be the problem ? Does Device definition of Galaxy Nexus causes the problem ? I am using Android SDK 4.2.

Stijn Geukens
  • 15,454
  • 8
  • 66
  • 101
user1939622
  • 41
  • 1
  • 4

1 Answers1

0

Now I want to know which layout is suitable for devices with resolution 720x1280, density xhdpi and size normal.

res/layout/ works nicely. If you are also supporting -small screen devices, have an additional res/layout-small/ for those. You may or may not also wish -land variants (e.g., res/layout-land/) if you want different layouts for different screen orientations.

I already tried layout-xhdpi-1280x720 and Galaxy S3 device is loading screens from here, but not Galaxy Nexus.

That approach has been deprecated for years.

I don't want any tablet to run my app.

Then specify the appropriate <compatible-screens> element in your manifest, to state that you only support small and normal screens, not large and xlarge. This has nothing to do with your choice of layout resource directory.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • Thanks. But what i need to develop an app for devices 720x1280 resolution. – user1939622 Jan 01 '13 at 05:26
  • 1
    @user1939622: `res/layout/` works for any resolution. What *other* layout resource directories you have determine whether the files in `res/layout/` get used for any given device. – CommonsWare Jan 01 '13 at 12:05
  • @CommonsWare the current setup is ridiculous. Layout folders should be organized so that every resolution within a given sw/w can be accounted for exactly. Layout folders should reference resolution as well as size. For example: layout-sw360dp-xhdpi, layout-sw360dp-xxdpi,layout-sw360dp-xxxdpi... this allows very precise control of images and layouts for odd screen specs. The current system is a mishmash of stupid ideas on top of stupid ideas limiting flexibility and requiring ad-hoc hacks to fix the dumb. – me_ Aug 04 '18 at 01:48
  • @me_: "Layout folders should be organized so that every resolution within a given sw/w can be accounted for exactly" -- and what precisely is your plan for freeform multiwindow environments (Chrome OS, Samsung DeX, etc.), where the user can choose the resolution of the window? Android developers, just like desktop and Web developers, can create fluid layouts that adapt to different resolutions. – CommonsWare Aug 04 '18 at 11:12
  • @CommonsWare It's probably better than the android development team's plan for graphical development. Material Design wasn't a choice. It was the unfortunate result of destroying graphics portability. – me_ Aug 04 '18 at 11:14
  • @CommonsWare Setting aside that you just said every developer out there should bend over backwards due to the existence of a subset of developers. – me_ Aug 04 '18 at 11:17
  • @me_: All Web developers need to deal with different resolutions. Most desktop developers need to deal with different resolutions. Dealing with different resolutions has been part of client-side programming for decades. Countless developers have managed to figure it out. – CommonsWare Aug 04 '18 at 11:25
  • @CommonsWare Which one of them figured out how to split pixels in half? – me_ Aug 04 '18 at 12:14