Android examples for Hardware:Gps
has GPS Enabled
//package com.java2s; import android.content.Context; import android.location.LocationManager; public class Main { public static boolean hasGPSEnabled(Context context) { LocationManager locationManager = (LocationManager) context .getSystemService(Context.LOCATION_SERVICE); return locationManager .isProviderEnabled(LocationManager.GPS_PROVIDER); }//w w w . j a v a 2 s. c om }