简体   繁体   中英

Get Internal Available Storage in Device

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.

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());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM