Android Open Source - mantis-android-admob Ad Response






From Project

Back to project page mantis-android-admob.

License

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.

Java Source Code

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);
  }
}




Java Source Code List

com.mantisadnetwork.android.admob.AdRequestTask.java
com.mantisadnetwork.android.admob.AdRequest.java
com.mantisadnetwork.android.admob.AdResponse.java
com.mantisadnetwork.android.admob.Ad.java
com.mantisadnetwork.android.admob.Context.java
com.mantisadnetwork.android.admob.Mediation.java
com.mantisadnetwork.android.admob.UserContext.java