标签:style java os 文件 ar 问题 line new sp
1、perm.properties文件的配置
iapp.perm.CAMERA=摄像头
iapp.perm.SMS=短信
2、读取properties配置文件的内容(通过java.lang.Class类的getResourceAsStream(String name) 方法来实现)
public class Test {
public static void main(String[] args) {
Properties properties = new Properties();
InputStream in = Test.class.getClassLoader().getResourceAsStream("/perm.properties");
//properties.load(in);
properties.load(new InputStreamReader(in, "UTF-8")); //解决中文乱码问题
String camera = properties.get("iapp.perm.CAMERA").toString();
String sms = properties.get("iapp.perm.SMS").toString();
}
}
标签:style java os 文件 ar 问题 line new sp
原文地址:http://blog.csdn.net/leeyefang/article/details/38817853