本文整理了Java中android.os.Environment.getRootDirectory()
方法的一些代码示例,展示了Environment.getRootDirectory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.getRootDirectory()
方法的具体详情如下:
包路径:android.os.Environment
类名称:Environment
方法名:getRootDirectory
暂无
代码示例来源:origin: aa112901/remusic
private BuildProperties() throws IOException {
properties = new Properties();
properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
}
代码示例来源:origin: android-hacker/VirtualXposed
private OSUtils() {
Properties properties;
try {
properties = new Properties();
properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
} catch (IOException e) {
properties = null;
}
if (properties != null) {
emui = !TextUtils.isEmpty(properties.getProperty(KEY_EMUI_VERSION_CODE));
miuiVersion = properties.getProperty(KEY_MIUI_VERSION_CODE);
miui = !TextUtils.isEmpty(miuiVersion) || !TextUtils.isEmpty(properties.getProperty(KEY_MIUI_VERSION_NAME))
|| !TextUtils.isEmpty(properties.getProperty(KEY_MIUI_INTERNAL_STORAGE));
}
flyme = hasFlyme();
}
代码示例来源:origin: jaydenxiao2016/AndroidFire
public Builder(ImageLoader loader) {
this.loader = loader;
if (FileUtils.isSdCardAvailable())
filePath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Camera";
else
filePath = Environment.getRootDirectory().getAbsolutePath() + "/Camera";
titleBgColor = Color.BLACK;
titleColor = Color.WHITE;
btnBgColor = Color.TRANSPARENT;
btnTextColor = Color.WHITE;
FileUtils.createDir(filePath);
}
代码示例来源:origin: Bilibili/DanmakuFlameMaster
public static synchronized ARCH getMyCpuArch() {
byte[] data = new byte[20];
File libc = new File(Environment.getRootDirectory(), "lib/libc.so");
if (libc.canRead()) {
RandomAccessFile fp = null;
代码示例来源:origin: joyoyao/superCleanMaster
public static SDCardInfo getRootSpaceInfo() {
File path = Environment.getRootDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long totalBlocks = stat.getBlockCount();
long availableBlocks = stat.getAvailableBlocks();
long totalSize = blockSize * totalBlocks;
long availSize = availableBlocks * blockSize;
// 获取SDCard上每个block的SIZE
long nBlocSize = stat.getBlockSize();
SDCardInfo info = new SDCardInfo();
// 计算SDCard 总容量大小MB
info.total = totalSize;
// 计算 SDCard 剩余大小MB
info.free = availSize;
return info;
}
}
代码示例来源:origin: roomanl/AndroidDownload
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: luhaoaimama1/zone-sdk
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: 18Gray/CommonUtils
/**
* 获取系统存储路径
*/
public static String getRootDirectoryPath()
{
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: Demidong/ClockView
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath()
{
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: InnoFang/Android-Code-Demos
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: HJXANDHMR/AndroidUtils
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
代码示例来源:origin: jjdxmashl/jjdxm_baseutils
/**
* 获取系统存储路径
*
* @return
*/
public static String getRootDirectoryPath() {
return Environment.getRootDirectory().getAbsolutePath();
}
}
代码示例来源:origin: MoMoWait/LeanbackLauncher
AppUsageStatistics(Context context) {
this.mAppUsageScore = null;
this.mLastGetAppUsageAdjustmentCall = 0;
this.mContext = context;
this.mUsageStatsManager = (UsageStatsManager) context.getSystemService("usagestats");
try {
mPrivilegedAppDir = new File(Environment.getRootDirectory(), "priv-app").getCanonicalPath();
} catch (IOException e) {
}
}
代码示例来源:origin: rockon999/LeanbackLauncher
AppUsageStatistics(Context context) {
this.mContext = context;
this.mUsageStatsManager = (UsageStatsManager) context.getSystemService("usagestats");
try {
mPrivilegedAppDir = new File(Environment.getRootDirectory(), "priv-app").getCanonicalPath();
} catch (IOException e) {
}
}
代码示例来源:origin: linqssonny/Utils
private static String getRootFolderAbsolutePath() {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
return Environment.getExternalStorageDirectory().getAbsolutePath();
} else {
return Environment.getRootDirectory().getAbsolutePath();
}
}
}
代码示例来源:origin: ZhuoKeTeam/QPM
private BuildProperties() throws IOException {
properties = new Properties();
properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
}
代码示例来源:origin: jethroMu/FunProj
private BuildProperties() throws IOException {
properties = new Properties();
properties.load(new FileInputStream(new File(Environment.getRootDirectory(), "build.prop")));
}
代码示例来源:origin: linqssonny/Utils
/***
* return folder absolute path external storage
*
* @return
*/
public static String getRootFolderAbsolutePath() {
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
return Environment.getExternalStorageDirectory().getAbsolutePath();
} else {
return Environment.getRootDirectory().getAbsolutePath();
}
}
}
代码示例来源:origin: dengshiwei/AndroidUtils
/**
* 获取系统存储路径
* @return
* SD卡存在返回正常路径;SD卡不存在返回""
*/
public static String getSDCardRootPath(){
if(isSDCardEnable()){
return Environment.getRootDirectory().getAbsolutePath() + File.separator;
}else{
return "";
}
}
代码示例来源:origin: dengshiwei/AndroidUtils
/**
* 获取系统存储路径
* @return
* SD卡存在返回正常路径;SD卡不存在返回null
*/
public static File getSDCardRootFile(){
if(isSDCardEnable()){
return Environment.getRootDirectory();
}else{
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!