This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 从Uri中获取真实路径 | |
* Created by chenenyu on 2018/12/24. | |
*/ | |
public class RealPathUtils { | |
public static String getRealPath(Context context, Uri fileUri) { | |
String realPath; | |
// SDK >= 11 && SDK < 19 | |
if (Build.VERSION.SDK_INT < 19) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
project.rootProject.buildscript.configurations.each { | |
if (it.name == ScriptHandler.CLASSPATH_CONFIGURATION) { // classpath | |
it.resolvedConfiguration.firstLevelModuleDependencies.each { | |
println("${it.moduleGroup}:${it.moduleName}:${it.moduleVersion}") | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 应用启动时间 | |
private long getStartTime() throws Exception { | |
if (Build.VERSION.SDK_INT >= 24) { | |
return Process.getStartElapsedRealtime(); | |
} | |
final String path = "/proc/" + Process.myPid() + "/stat"; | |
final BufferedReader reader = new BufferedReader(new FileReader(path)); | |
final String stat; | |
try { | |
stat = reader.readLine(); |