Package io.rong.common
Class LibStorageUtils
-
- All Implemented Interfaces:
public class LibStorageUtilsCreated by Android Studio. User: lvhongzhen Date: 2019-12-02 Time: 14:49
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringDIRpublic final static StringVIDEOpublic final static StringIMAGEpublic final static StringFILEpublic final static StringAUDIOpublic final static StringMEDIApublic final static StringDB_STORAGEpublic final static StringDB_STORAGE_PRIVATE
-
Constructor Summary
Constructors Constructor Description LibStorageUtils()
-
Method Summary
Modifier and Type Method Description static booleanisScopedStorageMode(Context context)是否处于分区存储模式 在以Android 11 为目标平台的应用上 targetSdkVersion>=30,必须设置rc_q_storage_mode_enable为true, 否则会导致图片,文件等媒体文件发送失败)static booleanisBuildAndTargetForQ(Context context)是否 Android SDK 版本号 >= Build.VERSION_CODES.Q且 目标软件开发版本>= Build.VERSION_CODES.Qstatic booleanisOsAndTargetForR(Context context)static StringgetMediaDownloadDir(Context context)获取媒体文件存储路径 static StringgetMediaDownloadDir(Context context, String dir)获取媒体文件存储路径 static StringgetFilesDir(Context pContext, String dir)static StringgetAppName(Context context)获取应用名称 -
-
Method Detail
-
isScopedStorageMode
static boolean isScopedStorageMode(Context context)
是否处于分区存储模式 在以Android 11 为目标平台的应用上
targetSdkVersion>=30,必须设置rc_q_storage_mode_enable为true, 否则会导致图片,文件等媒体文件发送失败)- Parameters:
context- 上下文- Returns:
是否处于 android 11 存储模式
-
isBuildAndTargetForQ
static boolean isBuildAndTargetForQ(Context context)
是否 Android SDK 版本号
>= Build.VERSION_CODES.Q且 目标软件开发版本>= Build.VERSION_CODES.Q- Parameters:
context- 上下文- Returns:
是否 Android SDK 版本号
>= Build.VERSION_CODES.Q且 目标软件开发版本>= Build.VERSION_CODES.Q
-
isOsAndTargetForR
static boolean isOsAndTargetForR(Context context)
- Returns:
是否系统版本
>=R且目标平台target >= Build.VERSION_CODES.R
-
getMediaDownloadDir
@Deprecated() static String getMediaDownloadDir(Context context)
获取媒体文件存储路径
- Parameters:
context- 上下文- Returns:
媒体文件存储路径
-
getMediaDownloadDir
static String getMediaDownloadDir(Context context, String dir)
获取媒体文件存储路径
- Parameters:
context- 上下文dir- 自定义目录- Returns:
媒体文件存储路径
-
getFilesDir
static String getFilesDir(Context pContext, String dir)
-
getAppName
static String getAppName(Context context)
获取应用名称
- Parameters:
context- 上下文- Returns:
应用名称
-
-
-
-