Giter Club home page Giter Club logo

androidads's Introduction

For Native/Banner/Interstitial

1: Add in build.gradle

implementation 'com.github.AppDev321:AndroidAds:1.+'

2: Add in root build.gradle in allprojects tag

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

Step 1 #

Add in manifest for ad mobs under application tag

			<meta-data
            android:name="com.google.android.gms.ads.APPLICATION_ID"
            android:value="ca-app-pub-3940256099942544~3347511713" />  //Replace your admob application ID
			
 tools:replace="android:theme" // this in application tag

Step 2 #

Initialize ads Ids , if you dont use any of ad network replace with empty

          AppData appData = new AppData(getResources().getString(R.string.banner_ad_unit_id),
            getResources().getString(R.string.interstitial_ad_unit_id),
            getResources().getString(R.string.native_ad_unit_id),
            getResources().getString(R.string.fb_banner_ad_unit_id),
            getResources().getString(R.string.fb_interstitial_ad_unit_id),
            getResources().getString(R.string.fb_native_ad_unit_id));
            AdConfig.getAppData = appData;

Step 3 #

String	adTypes:
	0 = no add
	1 = admob ads
	2 = facebook ads

For banner

  	new AdsBanner(adTypes,this, (RelativeLayout) findViewById(R.id.rl_ad)); //Replace your banner add layout

For interstitial

  AdsInterstitial adsFullScreen2 = new AdsInterstitial(adTypes,this); //intialize oncreate 
  
//Now call to show interstial on everywhere in class

adsFullScreen2.showActivityAd(new Intent(MainActivity.this, SecondClass.class)); //Replace your activities if you dont want to move to next class then send null in params

For Native ads calling

  	new AdsNative(adTypes,this, (FrameLayout) findViewById(R.id.fl_adplaceholder));

androidads's People

Contributors

appdev321 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.