android Plist parser xml Assets


/ Published in: Java
Save to your folder(s)

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


Copy this code and paste it in your HTML
  1. /// Read plist from Assets
  2. private String readPlistFromAssets(Context context, String path) {
  3. BufferedReader br = null;
  4. try {
  5. br = new BufferedReader(new InputStreamReader(context.getAssets().open(path)));
  6. String temp;
  7. while ((temp = br.readLine()) != null)
  8. sb.append(temp);
  9. } catch (IOException e) {
  10. e.printStackTrace();
  11. } finally {
  12. try {
  13. br.close(); // stop reading
  14. } catch (IOException ex) {
  15. ex.printStackTrace();
  16. }
  17. }
  18. return sb.toString();
  19. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.