-1

I have a project where i am integrating Admob BANNER, INSTERSTITIAL and Native ads. I can integrate INTERSTITIAL and BANNER. but i dont know how to integrate NATIVE ADS. I am working in eclipse below is how i am integrating interstitial and banner.

          final InterstitialAd interstitial;
     //(((((((((( ADMOB Banner Ads )))))))
        AdView adView = (AdView) view.findViewById(R.id.adView);            
        AdRequest adRequest = new AdRequest.Builder().build();
        adView.loadAd(adRequest);


interstitial = new InterstitialAd(activity);
interstitial.setAdUnitId("ca-app-pub-5900269475646349/1619195915");

//AdRequest  adRequest = new AdRequest.Builder().build();
interstitial.loadAd(adRequest);

 interstitial.setAdListener(new AdListener() 
    {
        // Listen for when user closes ad
        public void onAdClosed() 
        {
             //Load Interesterial add
             // AdRequest  adRequest = new AdRequest.Builder()
           //  .build();
         //    interstitial.loadAd(adRequest); 

        }

        public void onAdLoaded() 
        {
            if (interstitial.isLoaded()) {
                interstitial.show();
            }
        }
    });             
Pir Fahim Shah
  • 10,505
  • 1
  • 82
  • 81

1 Answers1

1

To add native ads you have to use the latest googleplayservices lib.

To use it you have to add all projects in Sdk\extras\google\m2repository\com\google\android\gms\ as projects. I mean, extract , e.g. , play-services-10.2.0.aar as archive and add it into eclipse as library project. Do it with Sdk\extras\google\m2repository\com\google\android\gms\play-services-ads-lite\10.2.0\ too.

Vyacheslav
  • 26,359
  • 19
  • 112
  • 194