-
public class UtilsUtils.
-
-
Method Summary
Modifier and Type Method Description static FilecreateFile(String path)create a file with a path if this file isn't exist. static booleancheckAndCreateDir(String path)create a Directory with a path if this Directory isn't exist. static StringgetProcessName(Context ctx, int pid)Get ProcessName. static StringgetSystemProperty(String key, String defaultValue)Get SystemProperty. static booleanisMIUI()static StringgetMobileModel()Get MobileModel. static ActivitygetActivityFromContext(Context context)< getActivityFromContext >. static booleanisForeground(Context context)判断当前应用是否在前台. -
-
Method Detail
-
createFile
static File createFile(String path)
create a file with a path if this file isn't exist.
- Parameters:
path- 路径
-
checkAndCreateDir
static boolean checkAndCreateDir(String path)
create a Directory with a path if this Directory isn't exist.
- Parameters:
path- path
-
getProcessName
static String getProcessName(Context ctx, int pid)
Get ProcessName.
- Parameters:
ctx- Contextpid- pid
-
getSystemProperty
static String getSystemProperty(String key, String defaultValue)
Get SystemProperty.
- Parameters:
key- keydefaultValue- defaultValue
-
isMIUI
static boolean isMIUI()
-
getMobileModel
static String getMobileModel()
Get MobileModel.
-
getActivityFromContext
static Activity getActivityFromContext(Context context)
< getActivityFromContext >.
- Parameters:
context- context
-
isForeground
static boolean isForeground(Context context)
判断当前应用是否在前台.
-
-
-
-