private static Properties prop = null;
public PropertiesUtil(Context context, String filePath){
InputStream in = null;
try {
in = context.getAssets().open(filePath);
prop = new Properties();
prop.load(in);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (in != null) {
try {
in.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
public String getProperty(String name, String defValue) {
if(prop != null){
return prop.getProperty(name, defValue);
}
return "";
}
}
对应文件:
versionDisplayText=2.0.17_CHUANGWEI4K_RTK2995_20140726.154557
alipay=1
appid=-1
showtv=1
downloadurl=http://appinterface.voole.com/interface/appplatform_Download_download.htm?oemid=797&packagename=com.voole.epg&version=1.1&partnerid=2011&sdkversion=2.2&uid=0&hid=123456789012&appid=47
upgradeurl=http://appinterface.voole.com
PageReportUrl=http://appinterface.voole.com/interface/appplatform_PageActionReport_actionReport.htm
keycodetype=Standard
versionCode=2.0.17001121
# if true up or down controlvalue
controlVolume=false
oemType=TCL_Desktop
installServer=0
clearAuthConfig=1
bootStartAuth=1
sdcardurl=/mnt/sdb/sdb1/ios.mp4
通过方法取对应值