Skip to content

Banner Ads API

CMAdSDK edited this page May 19, 2016 · 14 revisions

The main APIs for the Banner Ad

The SDK Base Version APIs of the Banner Ad are the same as the SDK Ext Version.

  • com.cmcm.adsdk.banner.CMNativeBannerView

    Methodology Method Introduction
    setPosid(String posid) Set ad position id
    setAdSize(CMBannerSize size) Set banner size
    setAdListener(CMBannerAdListener listener) Set banner callback interface
    loadAd() downloading ad
    prepare() after the success of the load needs to display ads invoke this method
  • com.cmcm.adsdk.banner.CMBannerAdListener

    Methodology Method Introduction
    onAdLoaded(CMAdView view) ad request success
    adFailedToLoad(CMAdView view, int error) ad request failure
    onAdClicked(CMAdView view) ad click
  • com.cmcm.adsdk.banner.CMBannerAdSize

    Parameter Name Parameters description
    CMBannerAdSize.BANNER_320_50 320 * 50 size
    CMBannerAdSize.BANNER_300_250 320 * 250 size

Clone this wiki locally