FatFractal customer forums



Author Topic: NSDictionary equivalent in Android  (Read 8182 times)

erka

  • Newbie
  • *
  • Posts: 29
    • View Profile
Re: NSDictionary equivalent in Android
« Reply #15 on: March 12, 2014, 07:17:42 AM »
It works. Thank you kevin and gkc for your swift response and fix!

This is the code I use for getting the values out of the Map incase anyone needs it or have suggestions for improvements:
Code: [Select]
try {
List<MinigameData> minigameData = ff.getArrayFromUri("/MinigameData");

for(int i = 0; i < minigameData.size(); i++) {

Map<String, Object> data = minigameData.get(i).getData();

if(data != null && data.containsKey("circleViewFrames")) {

ArrayList<Map> circleViewFrames = (ArrayList) data.get("circleViewFrames");

for(int c = 0; c < circleViewFrames.size(); c++) {
String circleId = String.valueOf(c+1);
Map<String, Object> circleView = circleViewFrames.get(c);
Map<String, Object> circleViewProperties = (Map) circleView.get("circleView" + circleId);
Integer height = (Integer) circleViewProperties.get("Height");
Integer width = (Integer) circleViewProperties.get("Width");
Integer x = (Integer) circleViewProperties.get("X");
Integer y = (Integer) circleViewProperties.get("Y");
}
}
}

} catch (FFException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
« Last Edit: March 12, 2014, 07:35:51 AM by erka »

kevin@fatfractal.com

  • Administrator
  • *****
  • Posts: 56
    • View Profile
Re: NSDictionary equivalent in Android
« Reply #16 on: March 12, 2014, 11:59:47 AM »
Yay!!

All thanks to Gary (gkc) - he did all the real work.

Appreciate your patience.

Kevin

 

Copyright © FatFractal customer forums