Android Open Source - mantis-android-admob Ad






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;
//  w  w  w  .ja  va 2 s  . c om
import org.json.JSONException;
import org.json.JSONObject;

import android.net.Uri;

public class Ad {
  private String image;
  private String url;
  private int width;
  private int height;

  public Ad(JSONObject json) {
    try {
      image = json.getString("image");
      url = json.getString("url");
      width = json.getInt("width");
      height = json.getInt("height");
    } catch (JSONException e) {
      //throw new RuntimeException("There was a problem converting JSON ad into object", e);
      
    }
  }

  public String getImage() {
    return image;
  }

  public String getUrl() {
    return url;
  }

  public Uri getUri() {
    return Uri.parse(this.getUrl());
  }

  public int getWidth() {
    return width;
  }

  public int getHeight() {
    return height;
  }
}




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