Android examples for android.location:GPS
is Gps Enabled
import android.content.Context; import android.location.LocationManager; public class Main { /**// w w w. ja v a 2 s . c o m * <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> */ public static boolean isGpsEnabled(Context context) { LocationManager lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); return lm.isProviderEnabled(LocationManager.GPS_PROVIDER); } }