com.citygrid.ads.custom
Class CGAdsCustom
java.lang.Object
com.citygrid.ads.custom.CGAdsCustom
- All Implemented Interfaces:
- Serializable, Cloneable
public class CGAdsCustom
- extends Object
- implements Serializable, Cloneable
The Custom Ads SDK allows you to build custom ads and featured details in your application.
It allows you have preferred placement for local advertisers to help you earn money directly on the page.
Let's pretend you want to present a restaurant custom ad based on the latitude and longitude of the device.
CGAdsCustom search = CityGrid.adsCustom();
search.setWhat("restaurant");
search.setLatlon(new CGLatLon(34.0522222d, -118.2427778d));
search.setRadius(20.0f);
CGAdsCustomResults results = search.search();
for (CGAdsCustomAd ad : results.getAds()) {
// do something with the add
}
Next, we'll pretend the user clicked on the ad and you wish to show a detail to help you monetize.
CGAdsCustomAd ad = results.getAd();
CGPlacesDetailLocation detailLocation = ad.placesDetailLocation();
// do something with the detail location, maybe even track it CGPlacesDetailLocation.track(muid, mobileType).
- See Also:
- Serialized Form
CGAdsCustomWhereUri
private static final String CGAdsCustomWhereUri
- See Also:
- Constant Field Values
CGAdsCustomLatLonUri
private static final String CGAdsCustomLatLonUri
- See Also:
- Constant Field Values
publisher
private String publisher
ua
private String ua
serveUrl
private String serveUrl
rawWhat
private String rawWhat
rawWhere
private String rawWhere
what
private String what
where
private String where
max
private int max
placement
private String placement
impressionId
private String impressionId
latlon
private CGLatLon latlon
radius
private float radius
connectTimeout
private int connectTimeout
readTimeout
private int readTimeout
CGAdsCustom
public CGAdsCustom(String publisher)
adsCustom
public static CGAdsCustom adsCustom()
adsCustomWithPublisher
public static CGAdsCustom adsCustomWithPublisher(String publisher)
adsCustomWithPlacement
public static CGAdsCustom adsCustomWithPlacement(String placement)
adsCustomWithPublisherAndPlacement
public static CGAdsCustom adsCustomWithPublisherAndPlacement(String publisher,
String placement)
search
public CGAdsCustomResults search()
throws CGException
- Throws:
CGException
processResults
private CGAdsCustomResults processResults(org.codehaus.jackson.JsonNode rootNode)
processAds
private CGAdsCustomAd[] processAds(org.codehaus.jackson.JsonNode parsedAds)
validate
private List<CGError> validate()
build
private Map<String,Object> build()
getPublisher
public String getPublisher()
setPublisher
public void setPublisher(String publisher)
getUa
public String getUa()
setUa
public void setUa(String ua)
getServeUrl
public String getServeUrl()
setServeUrl
public void setServeUrl(String serveUrl)
getRawWhat
public String getRawWhat()
setRawWhat
public void setRawWhat(String rawWhat)
getRawWhere
public String getRawWhere()
setRawWhere
public void setRawWhere(String rawWhere)
getWhat
public String getWhat()
setWhat
public void setWhat(String what)
getWhere
public String getWhere()
setWhere
public void setWhere(String where)
getMax
public int getMax()
setMax
public void setMax(int max)
getPlacement
public String getPlacement()
setPlacement
public void setPlacement(String placement)
getImpressionId
public String getImpressionId()
setImpressionId
public void setImpressionId(String impressionId)
getLatlon
public CGLatLon getLatlon()
setLatlon
public void setLatlon(CGLatLon latlon)
getRadius
public float getRadius()
setRadius
public void setRadius(float radius)
getConnectTimeout
public int getConnectTimeout()
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
getReadTimeout
public int getReadTimeout()
setReadTimeout
public void setReadTimeout(int readTimeout)
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
hashCode
public int hashCode()
- Overrides:
hashCode
in class Object
toString
public String toString()
- Overrides:
toString
in class Object
clone
public Object clone()
throws CloneNotSupportedException
- Overrides:
clone
in class Object
- Throws:
CloneNotSupportedException
Copyright © 2011. All Rights Reserved.