NativeAd
このクラスには新しいバージョンがあります。ご確認ください。 最新バージョン

NativeAd provides ad creative for apps to rendered in custom layout.

To use NativeAd, do the following:

NativeAd nativeAd = new NativeAd(context, PLACEMENT_ID); nativeAd.setAdListener(new AdListener() { public void onAdLoaded(Ad ad) { if (ad == nativeAd) { // Renders the ad using creative properties String adTitle = getAdTitle(); } } // rest of AdListener implementation omitted }); nativeAd.loadAd();

Before displaying the ad, call NativeAd.registerViewForInteraction(View viewContainer) to handle logging of ad impressions and clicks.

拡張:NativeAdInternal
パッケージ:ads
コンストラクター
NativeAd(Context, String)

Constructs an NativeAd using the given context and placement id.

public NativeAd(Context context, String placementId)
パラメーター説明
contextAndroid context
placementIdId of ad placement
クラスメソッド
downloadAndDisplayImage(Image, ImageView)

Downloads the given Image and displays it in the given ImageView.

This method always returns immediately. Image is downloaded asynchronously.

public static void downloadAndDisplayImage(Image image, ImageView imageView)
パラメーター説明
imageImage to be downloaded
imageViewView to show the downloaded image
インスタンスメソッド
loadAd()

Loads an ad.

This method always returns immediately. The ad is loaded asynchronously. The control's ad listener will be called when loading finishes or fails.

public void loadAd()