com.citygrid.ads.mobile
Class CGAdsMobile
java.lang.Object
com.citygrid.ads.mobile.CGAdsMobile
- All Implemented Interfaces:
- Serializable, Cloneable
public class CGAdsMobile
- extends Object
- implements Serializable, Cloneable
The Mobile Ads SDK allows you to show a mobile ad directly in your app that is similar in size to other ad providers.
You can then present a detail and track actions similarly to Custom Ads.
To use this API, it is necessary to provide the mobile device' MUID.
Let's pretend you wanted to present a restaurant banner add for an mobile device based
on the latitude and longitude of the device.
CityGrid.setPublisher("test");
CityGrid.setSimulation(false);
CityGrid.setMuid(YOUR_MUID);
CGAdsMobile search = CityGrid.adsMobile();
search.setWhat("restaurant");
search.setLatlon(new CGLatLon(33.786594d, -118.298662d));
search.setRadius(50.0f);
search.setCollection(CGAdsMobileCollection.Collection640x100);
search.setSize(new CGSize(640.0f, 100.0f));
CGAdsMobileResults results = search.banner();
for (CGAdsMobileAd ad : results.getAds()) {
// do something with the ad
}
Next, we'll pretend the user clicked on the ad and you wish to show a detail to help you monetize.
CGAdsMobileAd 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
CGAdsMobileBannerUri
private static final String CGAdsMobileBannerUri
- See Also:
- Constant Field Values
publisher
private String publisher
collection
private CGAdsMobileCollection collection
ua
private String ua
rawWhat
private String rawWhat
rawWhere
private String rawWhere
what
private String what
where
private String where
latlon
private CGLatLon latlon
radius
private float radius
max
private int max
placement
private String placement
impressionId
private String impressionId
size
private CGSize size
connectTimeout
private int connectTimeout
readTimeout
private int readTimeout
muid
private String muid
CGAdsMobile
public CGAdsMobile(String publisher)
adsMobile
public static CGAdsMobile adsMobile()
adsMobileWithPublisher
public static CGAdsMobile adsMobileWithPublisher(String publisher)
adsMobileWithPlacement
public static CGAdsMobile adsMobileWithPlacement(String placement)
adsMobileWithPublisherAndPlacement
public static CGAdsMobile adsMobileWithPublisherAndPlacement(String publisher,
String placement)
validate
private List<CGError> validate()
build
private Map<String,Object> build()
processAds
private CGAdsMobileAd[] processAds(org.codehaus.jackson.JsonNode parsedAds)
processResults
private CGAdsMobileResults processResults(org.codehaus.jackson.JsonNode parsedJson)
banner
public CGAdsMobileResults banner()
throws CGException
- Throws:
CGException
getPublisher
public String getPublisher()
setPublisher
public void setPublisher(String publisher)
getCollection
public CGAdsMobileCollection getCollection()
setCollection
public void setCollection(CGAdsMobileCollection collection)
setUa
public void setUa(String ua)
getUa
public String getUa()
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)
getLatlon
public CGLatLon getLatlon()
setLatlon
public void setLatlon(CGLatLon latlon)
getRadius
public float getRadius()
setRadius
public void setRadius(float radius)
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)
getSize
public CGSize getSize()
setSize
public void setSize(CGSize size)
getConnectTimeout
public int getConnectTimeout()
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
getReadTimeout
public int getReadTimeout()
setReadTimeout
public void setReadTimeout(int readTimeout)
getMuid
public String getMuid()
setMuid
public void setMuid(String muid)
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.