Will my ad generate revenue that has already been uploaded in a few hours

I use the Facebook Audience network and in accordance with this article

enter image description here

I do not cache ads, but ads remain on the screen without updating. I download all the ads at once, and they remain on the screen until the user closes the application.

private void initializeAds() {
        //ENABLE TESTING MODE
        if (BuildConfig.DEBUG) {
            AdSettings.addTestDevice("alksdfj");//For testing ads
        }

        //NATIVE AD
        nativeAd = new NativeAd(this, "alksdjf");
        nativeAd.setAdListener(new AdListener() {

            @Override
            public void onError(Ad ad, AdError adError) {

            }

            @Override
            public void onAdLoaded(Ad ad) {
                // Render the Native Ad Template
                View adView = NativeAdView.render(MainActivity.this, nativeAd, NativeAdView.Type.HEIGHT_120);
                LinearLayout nativeAdContainer = (LinearLayout) findViewById(R.id.native_ad_container);
                // Add the Native Ad View to your ad container
                nativeAdContainer.addView(adView);
            }

            @Override
            public void onAdClicked(Ad ad) {

            }

            @Override
            public void onLoggingImpression(Ad ad) {

            }
        });

        //BANNER AD
        // Instantiate an AdView view
        adView = new AdView(this, "alksdjf", AdSize.BANNER_HEIGHT_50);

        // Find the Ad Container
        LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container);

        // Add the ad view to your activity layout
        adContainer.addView(adView);


        //Interstitial AD
        interstitialAd = new InterstitialAd(this, "alskdfj");
        // Set listeners for the Interstitial Ad
        interstitialAd.setAdListener(new InterstitialAdListener() {
            @Override
            public void onInterstitialDisplayed(Ad ad) {
                // Interstitial displayed callback
            }

            @Override
            public void onInterstitialDismissed(Ad ad) {
                // Interstitial dismissed callback
            }

            @Override
            public void onError(Ad ad, AdError adError) {
                // Ad error callback
                /*Toast.makeText(MainActivity.this, "Error: " + adError.getErrorMessage(),
                        Toast.LENGTH_LONG).show();*/
                Log.d("FACEBOOK_ADS", adError.getErrorMessage());
            }

            @Override
            public void onAdLoaded(Ad ad) {
                // Show the ad when it done loading.

            }

            @Override
            public void onAdClicked(Ad ad) {
                // Ad clicked callback
            }

            @Override
            public void onLoggingImpression(Ad ad) {
                // Ad impression logged callback
            }
        });


        // Request an ad
        nativeAd.loadAd();
        adView.loadAd();

        // For auto play video ads, it recommended to load the ad
        // at least 30 seconds before it is shown
        interstitialAd.loadAd();
        //interstitialAd.show();
    }

These ads may remain there for hours. I also use an interstitial ad that loads, but only shows to the user when the user unlocks his device. (User can take hours to unlock their device)

In this scenario, I want the abstract advertising to generate revenue, or I need to re-request the advertisement after some time, for example, using cached ads.

BannerAds . .

+6

All Articles