How to find the amount of free storage (disk space) left on Android?

后端 未结 10 1218
遇见更好的自我
遇见更好的自我 2020-12-02 14:25

I am trying to figure out the available disk space on the Android phone running my application. Is there a way to do this programmatically?

Thanks,

10条回答
  •  情歌与酒
    2020-12-02 15:10

    Try StatFs.getAvailableBlocks. You'll need to convert the block count to KB with getBlockSize.

提交回复
热议问题