2
votes

Iam developing an android application which is only for handset devices not tablets.

My app is intended for ICS devices with resolution 720x1280 and density xhdpi ( Ex: Galaxy S3, Galaxy Nexus, Xperia V etc )

If i use layout-sw360dp how can i prevent/block Nexus7 tablet from loading my app screen ?

Or how can restrict may app to run only in 720x1280 resolution handset devices ?

1

1 Answers

2
votes

First get device widh and height and easily you can control this.

  Display display = getWindowManager().getDefaultDisplay(); 
            int width = display.getWidth();
            int height = display.getHeight();

            System.out.println(width+" "+height);

            if(height>720 && width>1280)
            {
                mainActivityrun();
            }
          else
          {
               finish();
           }