android studio应用获取系统属性权限(SystemProperties)
2024-08-29 13:11:34
dependencies {
provided files(getLayoutLibPath())
} /** ZhangChao time:2014-12-31,get layoutlib.jar path. android.os.SystemProperties need it. */
// must called after "android" definition
def getLayoutLibPath() {
def rootDir = project.rootDir
def localProperties = new File(rootDir, "local.properties")
if (localProperties.exists()) {
Properties properties = new Properties()
localProperties.withInputStream {
instr -> properties.load(instr)
}
def sdkDir = properties.getProperty('sdk.dir')
def compileSdkVersion = android.compileSdkVersion
Console.println("app compileSdkVersion : " + compileSdkVersion)
def androidJarPath = sdkDir + "/platforms/" + compileSdkVersion + "/data/layoutlib.jar"
return androidJarPath
}
return rootDir
}
最新文章
- POJ2505 A multiplication game[博弈论]
- springmvc 接受特殊类型字段的处理方法
- java中对象的初始化过程
- 在WPF下快速生成线的方法
- DP+BIT(优化复杂度) UESTC 1217 The Battle of Chibi
- Xfce 快捷键
- django - settings
- atomic_t原子操作
- chk cloud
- 分享一个MD5加密工具类
- jsp的C标签一般使用方法以及js接收servlet中的对象及对象数字
- c语言基础学习08_内存管理
- ajax参数传递与后台接收
- iptables和netfilter
- python_字符串的操作
- 【洛谷 P1616 疯狂的采药】
- Spring boot自定义启动字符画(banner)
- [leetcode]65. Valid Number 有效数值
- 设计模式之状态模式(State )
- SpringBoot配置属性之Security