android Plist解析器xml资产

【android Plist解析器xml资产】一身转战三千里,一剑曾当百万师。这篇文章主要讲述android Plist解析器xml资产相关的知识,希望能为你提供帮助。
http://kpbird.blogspot.hk/2011/08/android-plist-parser.html

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


    推荐阅读