0

I am very confuse now for set layout and drawable folder. I want that my graphics support both Galaxy nexus 7 asus and Galaxy tab. I prepare a demo app first and what I saw both support hdpi folder with normal layout. But both have different resolution and density. so my graphics not good look in Galaxy tab. I search and find so many links and go through that but not working for me. Don't know what mistake i do. Please correct me or give me any suggestions.

Preferred link: galaxy tab 7 vs nexus 7 different dimensions res folder

Layout folders for Google Nexus 7 and 10

Community
  • 1
  • 1
kalpana c
  • 2,739
  • 3
  • 27
  • 47

2 Answers2

1

The Nexus7 is a unique device, with a somewhat strange dpi structure.

For more than you probably need to know, here is a very good explanation (from Dianne Hackborn - an Android engineer at Google): Dianne Hackborn explains the unique resolution of the Nexus7

The Nexus7 will use resources out of the xhdpi folder - and scale them for it's unique resolution.

This is the first time this has been done, so is definitely unique (and explains why you might be seeing strange behavior).

Booger
  • 18,579
  • 7
  • 55
  • 72
  • But Both Galaxy Tab 4 7" and Nexus 7" takes the value from tvdpi folders, but both are different screen size. It make the problem, now How Can I place values only for Nexus 7 and Tab 4 7" – Thamilan S Aug 06 '14 at 09:47
-1

There may be two possible solutions.

1. First is you can use a new folder for the layout of the galaxy tab named layout-sw600dp and keep your layout xml file with new layout for galaxy tab.refer this link. res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger)

2. The second solution may be that you manually find out the resolutions of the mobile and set the drawables for the resolution manually.

    DisplayMetrics metrics = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(metrics);
    int scrheight = metrics.heightPixels;
    int scrwidth = metrics.widthPixels;
            if(scrheight==1024 && scrwidth==600)
            {
            **set ur resources here**
            }
Abhishek Agarwal
  • 1,907
  • 12
  • 21