title: How to detect 7" Android tablet in code
body: <p>I am trying to detect 7" tablets in my code (i.e. Kindle Fire &amp; Nook Color).  However, simply testing for minimum dimensions 1024x600 is not good, because then the Galaxy Nexus would pass this test as well.  Anybody has experience with detecting this kind of information?</p>
  
  <p>Thanks,
  Igor</p>
  
  <p><strong>EDIT:</strong>
  I have found one way to detect Kindle Fire &amp; Nook Color devices with the following code:</p>
  
  <pre><code>Activity activity = (Activity) activityContext;
  activity.getWindowManager().getDefaultDisplay().getMetrics(metrics);
  int width = activity.getWindowManager().getDefaultDisplay().getWidth();
  int height = activity.getWindowManager().getDefaultDisplay().getHeight();
  if ((width == 1024 &amp;&amp; height == 600) || (width == 600 &amp;&amp; height == 1024)) {    
          //Detects 7" tablets: i.e. Kindle Fire &amp; Nook Color
          isTablet = true;
      }
  </code></pre>