title: How to check whether an android device has  gps support or not?
body: <p>i'm trying to write a method which checks the gps support of android device.
  Although having gps support on emulator, it always returns false. But when i try it on my android devices it returns true. What can be reason of that?</p>
  
  <pre><code>public boolean isGpsAvailable() {
      PackageManager pm = this.getPackageManager();
      if (pm.hasSystemFeature(PackageManager.FEATURE_LOCATION_GPS)) {
          return true;
      } else {
          return false;
      }
  }
  </code></pre>