public class StorageUtils extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
getCachePath(android.content.Context context,
String dir)
获取app缓存路径
|
static String |
getFilesPath(android.content.Context context,
String dir)
获取app文件数据路径
|
static long |
getFreeBytes(String filePath)
获取指定路径所在空间的剩余可用容量字节数,单位byte
|
static String |
getRootDirectoryPath()
获取系统存储路径
|
static long |
getSDCardAllSize()
获取SD卡的剩余容量 单位byte
|
static String |
getSDCardPath()
获取SD卡路径
|
static boolean |
isSDCardEnable()
判断SDCard是否可用
|
static boolean |
saveImageToGallery(android.content.Context context,
android.graphics.Bitmap bmp,
String dir,
String fileName)
存储图片到系统相册(默认以系统时间为文件名)
|
public static boolean isSDCardEnable()
public static String getSDCardPath()
public static long getSDCardAllSize()
public static long getFreeBytes(String filePath)
filePath - public static String getRootDirectoryPath()
public static String getFilesPath(android.content.Context context, String dir)
context - dir - public static String getCachePath(android.content.Context context, String dir)
context -