Return to Snippet

Revision: 58588
at July 23, 2012 14:15 by l01241


Updated Code
/// Read plist from Assets
	private String readPlistFromAssets(Context context, String path) {
		StringBuffer sb = new StringBuffer();
		BufferedReader br = null;
		try {
			br = new BufferedReader(new InputStreamReader(context.getAssets().open(path)));
			String temp;
			while ((temp = br.readLine()) != null)
				sb.append(temp);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				br.close(); // stop reading
			} catch (IOException ex) {
				ex.printStackTrace();
			}
		}
		return sb.toString();
	}

Revision: 58587
at July 23, 2012 14:11 by l01241


Initial Code
/// Read plist from Assets
	private String readPlistFromAssets(Context context, String path) {
		StringBuffer sb = new StringBuffer();
		BufferedReader br = null;
		try {
			br = new BufferedReader(new InputStreamReader(context.getAssets().open(path)));
			String temp;
			while ((temp = br.readLine()) != null)
				sb.append(temp);
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			try {
				br.close(); // stop reading
			} catch (IOException ex) {
				ex.printStackTrace();
			}
		}
		return sb.toString();
	}

Initial URL

                                

Initial Description
http://kpbird.blogspot.hk/2011/08/android-plist-parser.html

Initial Title
android Plist parser xml Assets

Initial Tags
xml, android

Initial Language
Java