GithubHelp home page GithubHelp logo

admanager's Introduction

AdManager

AdManager helps you to show ads.

Features

AdManager's unique set of features:

  • RemoteConfigHelper: Helper class for remote configs.
  • Custom Banner: Helps you to show custom banners via remote config urls.
  • Firebase Builtin Ads: Helps you to show popup ads.
  • Rate App: App rating dialog
  • Static Notification
  • Periodic Notification
  • Utilities: Samples in the sample module.
  • Adapters:
Interstitial Banner Native RecyclerView Adapter for Native Ads
Admob: OK OK OK OK
Facebook: OK OK OK OK
Ironsource: OK OK
AppLovin: OK
Unity: OK
Inmobi: OK
Mopub: OK

Add AdManager to your project:

AdManager is available on Jitpack. Please ensure that you are using the latest versions by checking here

Add the following Gradle configuration to your Android project:

// In your root build.gradle file:
buildscript {
    repositories {
        jcenter()
        maven { url 'https://jitpack.io' } // add repository
    }
}

// In your app projects build.gradle file:
dependencies {
    implementation 'com.github.fgustovo.admanager:adapter-admob:1.6.0'
    implementation 'com.github.fgustovo.admanager:adapter-unity:1.6.0'
    implementation 'com.github.fgustovo.admanager:adapter-applovin:1.6.0'
    implementation 'com.github.fgustovo.admanager:adapter-facebook:1.6.0'
    implementation 'com.github.fgustovo.admanager:custom-banner:1.6.0'
    implementation 'com.github.fgustovo.admanager:periodic-notification:1.6.0'
    implementation 'com.github.fgustovo.admanager:popup-promo:1.6.0'
}

Initialize libraries in the Application class

public class MyApplication extends Application {
    @Override
    public void onCreate() {
        super.onCreate();

        new AdmStaticNotification.Builder(this, R.string.easy_access_title, R.string.easy_access_text)
                .build();

        new PeriodicNotificationApp.Builder(this)
                .build();

        new RemoteConfigApp.Builder(RCUtils.getDefaults())
                .build();
    }
}

Create RCUtils to use RemoteConfigHelper easily

public class RCUtils {
    public final static String S1_ADMOB_ENABLED = "s1_admob_enabled";
    public static final String S1_FACEBOOK_ENABLED = "s1_facebook_enabled";

    // todo add other Consts

  private static HashMap<String, Object> defaults = null;

    public static HashMap<String, Object> getDefaults() {
        if (defaults == null) {
            defaults = new HashMap<>();
            defaults.put(S1_ADMOB_ENABLED, true);
            defaults.put(S1_FACEBOOK_ENABLED, true);

            // todo add other Consts
	    }
        return defaults;
    }
}
// In your Activity class:
AdManager manager = new AdManagerBuilder(this)
        .add(new AdmobAdapter(RCUtils.S1_ADMOB_ENABLED).withRemoteConfigId(RCUtils.S1_ADMOB_ID))
        .add(new FacebookAdapter(RCUtils.S1_FACEBOOK_ENABLED).withRemoteConfigId(RCUtils.S1_FACEBOOK_ID))
        .thenStart(Splash2Activity.class)
        .build();

You can check Sample project.


Displaying Options

Method Description Suitable For
manager.show(); Shows all ads serially. Splash 1
manager.showOne(); Shows only one ad per call Main menu ads
manager.showOneByTimeCap(long timeCap); Shows one ad with given time cap onResume
manager.showAndFinish(); Shows all ads and finishes current activity onExit

Custom Banner:

Fetches given Remote Config Key values and displayes Custom Banner.

<com.admanager.custombanner.view.CustomBanner
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  app:remoteConfigEnableKey="custom_banner_enabled"
  app:remoteConfigImageUrlKey="custom_banner_image_url"
  app:remoteConfigTargetUrlKey="custom_banner_click_url" />

admanager's People

Contributors

gokmendeniz avatar mhsnakdgn avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.