hunkar / mandh-admob-manager

Admob manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mandh Admob Helper

Status License


This project created for helping management of Admob in Mandh Android applications.

πŸ“ Table of Contents

🧐 About

Admob manager is making easy for Admob integrate to our applications. We expect to prevent confusing of updates and policies of Admob.

🎈 Usage

Add Jitpack to proect build.gradle

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
        ...
    }
}

Add implementation to app/build.gradle

dependencies {
    ...
    implementation 'com.github.hunkar:mandh-admob-manager:1.0.1'
    ...
}

We should init keys to Admanager

AdManager.setAdManager(getApplicationContext(),
                        ADMOB_APP_ID,
                        ADMOB_BANNER_ID,
                        ADMOB_INTERSTITIAL_ID);

We need to initialize of interstitial ads

InterstitialAdManager.initInterstitialAd();

We need to set activity in onCreate method of each activity

AdManager.setActivity(MainActivity.this);

This method shows interstitial ad immediately after initialize and ad is ready.

InterstitialAdManager.showOnReady();

This method shows interstitial ad.

InterstitialAdManager.showAd();

Banner view

    <com.mandh.googleadmanager.BannerView
        android:id="@+id/mandh_ad"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

To show banner view

BannerView bannerView = findViewById(R.id.mandh_ad);
bannerView.show();

We can close apps with this line

AdManager.setAdsClosed(true);

We can set range of showing interstital ads as millisecond.

AdManager.setInterstitialAdTimeout(5000);

πŸš€ TODO

  • Rewarded ads unit will added.
  • Native ads unit will be added.

✍️ Authors

About

Admob manager


Languages

Language:Java 100.0%