After spending many hours and long nights building the app, let’s start getting it off the ground and start earning money from it. Admob can display ads in your app and partner with advertisers all over the world making your hard work really pay off.

Admob network provides different types of ad formats. I implemented Banner Ads and Interstitial Ads into 123Flip app. The steps to implement admob are:

1) Create Ad Units in Admob
2) Import Mobile Ads SDK in Android Studio
3) For banner ad, add the AdView in your layout
4) Initialize Mobile Ads in your activity
Admob Tutorial 💰 How to add AdMob to your Android App | Google Admob Tutorial (2020)

Banner Ads in activity_main.xml

A mobile banner ad is a rectangular system-initiated ad unit, which can be either static or animated. Mobile banner ads are typically displayed on the top or bottom of the screen, sticking to the screen for the duration of the user session.

Banner Ad at the bottom of activity (AdView)

Add AdView to activity_main.xml

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
Read more

Initialize AdView in MainActivity: onCreate()

class MainActivity : AppCompatActivity() {
    companion object {
        private const val TAG = "MainActivity"
        private const val CREATE_REQUEST_CODE = 248
        private const val GAME_REQUEST_CODE = 173
Read more

Add Interstitial Ad in GamelistActivity

Interstitial ads provide rich interactive ads for users on mobile apps. Interstitial ads are designed to be placed between content, so they are best placed at natural app transition points. 

class GamelistActivity : AppCompatActivity() {
        private lateinit var mListener: onItemClickListener
        private var sortQuery: String = ""
Read more