public boolean isGPSEnabled(Context mContext){
  LocationManager locationManager=(LocationManager)mContext.getSystemService(Context.LOCATION_SERVICE);
  return locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER);
}

public boolean isGPSEnabled ( Context mContext ) { LocationManager locationManager = ( LocationManager ) mContext . getSystemService ( Context . LOCATION_SERVICE ) ; return locationManager . isProviderEnabled ( LocationManager . GPS_PROVIDER ) ; }
method to get gps status
