(1)如图文件位置所示
(2)文件内容如图所示:
(3)读取其中内容:Properties props = new Properties();
try {
int id = getApplicationContext().getResources().getIdentifier("androidpn", "raw", getPackageName());
props.load(getApplicationContext().getResources().openRawResource(id));
} catch (NotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
apiKey = props.getProperty("apiKey", "");
xmppHost = props.getProperty("xmppHost","");
xmppPort = props.getProperty("xmppPort","");
Log.v("", "apiKey:"+apiKey+" xmppHost:"+xmppHost+" xmppPort:"+xmppPort);
posted on 2013-05-11 14:44
Terry Zou 阅读(466)
评论(0) 编辑 收藏 所属分类:
Android