Hello, welcome to bunkerspoint. We know that how much time it takes to build a good working legit app and you are ready to show-off the world. But wait don’t you think your efforts should payback to you? In this post we’ll talk about how to monetize your Android app with Google Admob. Admob is a mobile advertising company managed by Google.

WHAT MONETIZING APP DOES:

When your app is monetized with any advertising company it would be, it allows to display their ads in your app and the company pays for those ads which are live in your app.

MONETIZE YOUR ANDROID APP:

MONETIZE YOUR ANDROID APP WITH ADS 1
  • Sign up for admob. You need to have a gmail account in order to register in admob
MONETIZE YOUR ANDROID APP WITH ADS 2
  • Go to Apps and add app. If you have already published your app in playstore then click yes and search your app by name,developer name etc .else if you hadn’t published your app then click no and enter your app name and add the app to admob.
MONETIZE YOUR ANDROID APP WITH ADS 3
  • Enter your app name and choose your os.
MONETIZE YOUR ANDROID APP WITH ADS 4
  • After adding the app, go to app’s overview and add ad unit and select any of the ad type(Banner, Interstitial, Rewarded)
  • Suppose you select Banner then give AD unit name a name and select the ad type you want like video, text etc.
  • Let the Automatic refresh be Google optimized and keep the rest of the settings same.
  • Select create AD UNIT and your done with creading the AD UNIT. Now you’ll need to connect your app to admob.

CONNECT YOUR APP TO ADMOB:

You need to connect your android app with the admob in order to show live ads in your app. Connecting android app to admob is pretty easy by Firebase. Firebase helps in analyzing your app easily. If you haven’t signed up for Firebase then sign up for it and login to Firebase and create a project, give it a name and add integrate the app to firebase by clicking Add App and follow the instructions on Add Firebase to your Android app. After these settings is done, link your project with Admob in firebase navigating to Integrations under settings or you could also link to Firebase project through Admob.

LIVE ADS IN YOUR APP:

To live the ads in your app, you need to add the admob dependency in your android app. In Android Studio, click on Assistant and select firebase. Now
You could easily follow the instructions from there on how to create ads in app and adding dependency etc. For instance we are going to show you how to create banner ads in your app using firebase but without assistant.

So firstly login to Firebase and then follow these simple steps.

  • Add the necessary firebase dependencies such as core, admob, analytics.
  • Copy these line of codes in your activity/main.xml

        <com.google.android.gms.ads.AdView
            xmlns:ads="http://schemas.android.com/apk/res-auto"
            android:id="@+id/adView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_centerHorizontal="true"
            android:layout_alignParentBottom="true"
            ads:adSize="BANNER"
            ads:adUnitId="ca-app-pub-3940256099942544/6300978111">
        </com.google.android.gms.ads.AdView>

Add this piece of code in MainActivity.java

import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.AdView;

public class MainActivity extends AppCompatActivity {
    private AdView mAdView;

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        MobileAds.initialize(this,
            "ca-app-pub-3940256099942544~3347511713");

        mAdView = findViewById(R.id.adView);
        AdRequest adRequest = new AdRequest.Builder().build();
        mAdView.loadAd(adRequest);
    }

Thats it , now you’ve monteized your app and you are ready to display ads in your app.


Note: Always use test Ad ID while you are testing your application, you should never use original Ad ID in your application when in testing/developing phase. If you do so you might get blocked from AdMob.
You could find the App’s id and ad unit id under App’s settings in Admob.
Follow more detailed instructions on how to create ads for interstitial, rewarded in the below link.
https://firebase.google.com/docs/admob/android/quick-start

LEAVE A REPLY

Please enter your comment!
Please enter your name here