title: GPS Manifest: GPS in App is optional, want to make it available to GPS less devices too
body: <p>On uploading my App onto the market today, I saw that it is only available to devices with GPS, so this excludes some tablets.</p>
  
  <p>GPS in my App is optional. Is it possible to release one App for devices with and without GPS or do I need to make an extra version (would be no problem, though)?</p>
  
  <p>If it is possible, I guess there is some sort of method to check if(deviceHasGPS()){...}. 
  Is there one ?</p>
  
  <p>This is the part of my manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.PREVENT_POWER_KEY" /&gt;
  &lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.READ_PHONE_STATE" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_SETTINGS" /&gt;
  &lt;uses-permission android:name="com.android.vending.CHECK_LICENSE" /&gt;
  </code></pre>
  
  <p>Edit: thanks for the Answer <a href="https://stackoverflow.com/users/1069068/raghav-sood">Raghav Sood</a>!</p>
  
  <p>Add to Manifest:</p>
  
  <pre><code>&lt;uses-feature android:name="android.hardware.location.gps" 
                android:required="false" /&gt;
  </code></pre>
  
  <p>Implement the following:</p>
  
  <pre><code>locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
  boolean deviceHasGPS = false;
      if (locationManager.getAllProviders().contains(LocationManager.GPS_PROVIDER)) {
          deviceHasGPS = true;
      }
  </code></pre>
  
  <p>to test it on a device with gps, just surround the gps things with if(deviceHasGPS){...}
  then remove in the manifest:</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  </code></pre>
  
  <p>set deviceHasGPS to always false and see if the App force closes.</p>