Java tutorial
//package com.java2s; import android.text.TextUtils; import java.io.File; public class Main { private static long getFileSize(String path) { if (TextUtils.isEmpty(path)) { return 0; } File filePath = new File(path); File[] itemList = filePath.listFiles(); long totalSize = 0; if (null != itemList) { for (File f : itemList) { if (f.exists() && f.isFile() && f.length() > 0) { totalSize = totalSize + f.length(); } } } return totalSize; } }