Android: launching Ads on click of a button -


I have developed an Android application that I plan to launch for free on the Google Playstore. However, for the purpose of income, I have embedded AdMob in my app. According to what I've researched, the developer is paid on the click of the ad only.

What do I want to do, when the user clicks the exit button of their app, I want to start some ads. To get the ad from the AdMob / ad, close my app

Inorder this I have the following code

:

  button exitButton = findViewById (R.id. ExitButton); ExitButton.setOnClickListener (New OnClickListener) {@Override Public Zero onClick (see v) {// TODO Automatic Created Stub / * Some code is here that will start an E * / MyActivity.this.finish () To exit the app}});  

The layout has an adview to display an ad inside:

  LinearLayout layout = (LinearLayout) findViewById (R.id.layout); AdView adView = New AdView (this, AdSize.BANNER, AdUnitID); Layout.addView (adview); AdRequest adRequest = new AdRequest (); AdRequest.addTestDevice (AdRequest.TEST_EMULATOR); // This emulator is to test on adView.loadAd (adRequest);  

Is there a way to launch advertising content on the exit button?

In advance thanks

I think you want an interstitial ad, those Full screen ads that appear in the app. . Are you requesting a small banner that should be visible in every activity, not just at the end

Information on:

In addition to this For the forced click, the user is restricted by admob and you may restrict your account (your rate will be very high and someone will be able to check it)


Comments