1

I need to know how much internal space is left on device, but "internal" space no external SD card.

This code is used for external SD space.

how-to-check-available-space-on-android-device-on-mini-sd-card

anyone know how to get the free internal space?

Thanks in advance.

Community
  • 1
  • 1
seba123neo
  • 4,688
  • 10
  • 35
  • 53
  • is [`File.getTotalSpace()`](http://download.oracle.com/javase/6/docs/api/java/io/File.html#getTotalSpace() supported in android ? – jmj Dec 30 '10 at 12:40
  • Yes. Try getFreeSpace() or getUsableSpace(). http://d.android.com/reference/java/io/File.html – Sergey Glotov Dec 30 '10 at 12:44

1 Answers1

5

The code you linked to is what you need. However, rather than:

StatFs stat = new StatFs(Environment.getExternalStorageDirectory().getPath());

use something like:

StatFs stat = new StatFs(getFilesDir().getPath());
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491