Preload - Admob Native Ads in ListView

I read how to add Native Ads to Listview in AdMob: Enabling AdMob native ad in listView

If my assumption is correct, then the ad will be loaded after the user scrolls to the position. Is it possible to pre-load your own ads, for example, in the same place as the requesting list data from the server?

And is Google allowed to upload ads several times, for example, when I want to show ads in every tenth position?

Any advice would be appreciated.

Thanks and respect.

+4
source share
1 answer

Native Express Adview 2 , , , ( , ) .

.

   contadorAnuncio=position; // position is the number of item assigned on listview  



    if (contadorAnuncio > 0 && contadorAnuncio % 9 == 0)
    {


        Log.i("Inicio en 10", "inicio anuncio"); 
        convertView.findViewById(R.id.adView).setVisibility(View.VISIBLE);
        NativeExpressAdView adView = (NativeExpressAdView) convertView.findViewById(R.id.adView);
        adView.loadAd(new AdRequest.Builder().build());
        adView.setTag(position);



    }else{
        convertView.findViewById(R.id.adView).setVisibility(View.GONE);

    }



    return convertView;

}

xml.

:

android: visibility = "gone" xmlns: ads = "http://schemas.android.com/apk/res-auto"

adSize.

 <com.google.android.gms.ads.NativeExpressAdView
    android:id="@+id/adView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    ads:adUnitId="@string/native_express_ad_unit_id"
    ads:adSize="FULL_WIDTHx400" 
    android:visibility="gone">
</com.google.android.gms.ads.NativeExpressAdView>

, Native Express.

-

+1

Source: https://habr.com/ru/post/1649148/


All Articles