title: How to check if the device has Low Storage on Android Oreo API 26 and Above
body: <p>How can I check if the device has low storage on Android 8 Oreo. I saw in the Android Documentation that the <strong>Intent.ACTION_DEVICE_STORAGE_LOW</strong> is deprecated in API 26.</p>
  
  <blockquote>
    <p><strong>This constant was deprecated in API level 26.</strong>
    if your app targets O or above, this broadcast will no longer be delivered to any BroadcastReceiver defined in your manifest. Instead, apps are strongly encouraged to use the improved getCacheDir() behavior so the system can automatically free up storage when needed.
                                                      <em>- Android Documentation</em></p>
  </blockquote>
  
  <p>They are encouraging me use getCacheDir() instead.</p>
  
  <p>But I don't understand much of it, as getCacheDir() seems to return the system cache directory path as a FILE object, which can only be used to clear cache or some such.</p>
  
  <p>But I need to check whether the device is running low on device storage. I hope someone will help me in this</p>