android获取raw文件内容

public String getAndroidpnProperties(String key, String defaultValue) {
		if (loadProperties() == null) {
			return defaultValue;
		}
		return loadProperties().getProperty(key, defaultValue);
	}

	protected Properties loadProperties() {
		Properties props = new Properties();
		try {
			int id = getApplicationContext().getResources().getIdentifier("androidpn", "raw", getApplicationContext().getPackageName());
			props.load(getApplicationContext().getResources().openRawResource(id));
		} catch (Exception e) {
		}
		return props;
	}

你可能感兴趣的:(android获取raw文件内容)