1.android /res/raw介绍
该目录下面主要是放一些静态资源,比如:视频,音频,txt文本......
2.定义一个属性文件android.properties
apiKey=1234567
xmlHost=10.0.2.2
xmlPort=8080
3.java文件读取
private Properties loadProperties() {
Properties props = new Properties();
try {
int id = context.getResources().getIdentifier("android", "raw",context.getPackageName());
props.load(context.getResources().openRawResource(id));
} catch (Exception e) {
Log.e(LOGTAG, "Could not find the properties file.", e);
// e.printStackTrace();