Code example for Properties

Methods: getProperty, load

0
	} 
	 
	public String get(String key)
	{ 
		Properties props = get();
		return (props!=null)?props.getProperty(key):null;
	} 
	 
	public Properties get() {
		FileInputStream fis = null;
		Properties props = new Properties();
		try{ 
			//读取files目录下的config 
			//fis = activity.openFileInput(APP_CONFIG); 
			 
			//读取app_config目录下的config 
			File dirConf = mContext.getDir(APP_CONFIG, Context.MODE_PRIVATE);
			fis = new FileInputStream(dirConf.getPath() + File.separator + APP_CONFIG);
			 
			props.load(fis);
		}catch(Exception e){
		}finally{ 
			try { 
				fis.close();
			} catch (Exception e) {}