int m = new StatFs(Environment.getExternalStorageDirectory().getPath())
.getBlockCount();
int n = new StatFs(Environment.getExternalStorageDirectory().getPath())
.getAvailableBlocks();
int SDcardCapacity = m * n;
其中SDcardCapacity 就是你想要的。

解决方案 »

  1.   

    String sdcard = Environment.getExternalStorageDirectory().getPath();
    File file = new File(sdcard);
    StatFs statFs = new StatFs(file.getPath());
    int availableSpare = (int) (statFs.getBlockSize()*((long)statFs.getAvailableBlocks()-4)); 
      

  2.   

    这个Android系统已经实现了啊。
      

  3.   

    Android 获取SD卡剩余容量String sdcard = Environment.getExternalStorageDirectory().getPath();
    File file = new File(sdcard);
    StatFs statFs = new StatFs(file.getPath());
    int availableSpare = (int) (statFs.getBlockSize()*((long)statFs.getAvailableBlocks()-4)); 需要import android.os.StatFs;