How to get an External storage sd card size (With Mounted SD card)?

后端 未结 4 1775
再見小時候
再見小時候 2020-12-05 08:33

Link :I worked on based on this Link

I added this line to find the size (both Internal and External) size,

return availableExternalMemorySize/(1024*1         


        
4条回答
  •  死守一世寂寞
    2020-12-05 08:58

    You can use getTotalSpace (), getFreeSpace () or getUsableSpace () https://developer.android.com/reference/java/io/File.html

    import java.io.File;
    import android.util.Log;
    ....
    File f = getMyFile();
    Log.d("MyApp", f.getTotalSpace()+"");
    ....
    

提交回复
热议问题