Back to project page mantis-android-admob.
The source code is released under:
MIT License
If you think the Android project mantis-android-admob listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.mantisadnetwork.android.admob; //from ww w. ja va2 s . c o m import java.util.HashMap; import java.util.Iterator; import java.util.Map; import org.json.JSONException; import org.json.JSONObject; public class AdResponse { private Map<String, Ad> ads = new HashMap<String, Ad>(); public AdResponse(){ } public AdResponse(JSONObject object) { JSONObject ads; try { ads = object.getJSONObject("ads"); @SuppressWarnings("unchecked") Iterator<String> itr = ads.keys(); while (itr.hasNext()) { String key = itr.next(); this.ads.put(key, new Ad(ads.getJSONObject(key))); } } catch (JSONException e) { //throw new RuntimeException("There was a problem converting MANTIS JSON to object", e); } } public Ad getAdForZone(String zone) { return this.ads.get(zone); } }