Here you can find the source of isGpsEnabled(Context c)
public static boolean isGpsEnabled(Context c)
//package com.java2s; //License from project: Open Source License import android.content.Context; import android.location.LocationManager; public class Main { public static boolean isGpsEnabled(Context c) { LocationManager service = (LocationManager) c .getSystemService(Context.LOCATION_SERVICE); return service.isProviderEnabled(LocationManager.GPS_PROVIDER); }//from w w w. java 2 s . c om }