Posted By

l01241 on 07/23/12


Tagged

xml parser plist assets android


Versions (?)

android Plist parser xml Assets


 / Published in: Java
 

http://kpbird.blogspot.hk/2011/08/android-plist-parser.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  

You need to login to post a comment.