Android plist Parser using dd-plist


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



Copy this code and paste it in your HTML
  1. {
  2. NSDictionary rootDict = getNSDFromPath(context, mapPinPath);
  3.  
  4. int len = rootDict.count(), i;
  5. for(i=1; i<=len; i++)
  6. {
  7. NSDictionary NSItem = (NSDictionary) rootDict.objectForKey("Item"+i);
  8.  
  9. NSDictionary NSMap = (NSDictionary) NSItem.objectForKey("Real");
  10. NSObject NSMapX = NSMap.objectForKey("x");
  11. NSObject NSMapY = NSMap.objectForKey("y");
  12.  
  13. NSDictionary NSReal = (NSDictionary) NSItem.objectForKey("Map");
  14. NSObject NSRealX = NSReal.objectForKey("x");
  15. NSObject NSRealY = NSReal.objectForKey("y");
  16.  
  17.  
  18.  
  19. //Log.d("NSObject","NSO: " + NSItem);
  20. }
  21.  
  22.  
  23. }
  24. private NSDictionary getNSDFromPath(Context context, String path) {
  25.  
  26. try {
  27. return (NSDictionary) PropertyListParser.parse(context.getAssets().open(path));
  28. } catch (Exception e) {
  29. // TODO Auto-generated catch block
  30. e.printStackTrace();
  31. }
  32. return null;
  33.  
  34. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.