code: public static boolean storageAvailable() {
          if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
              File sd = new File(Environment.getExternalStorageDirectory().getAbsolutePath());
              return sd.canWrite();
          } else {
              return false;
          }
      }
docs: SD is available.
  
  @return true, otherwise is false.