BidVertiser

Categories

Follow Us @web_learners

BidVertiser

Showing posts with label Admob Alternative Ads integration in Android App. Show all posts
Showing posts with label Admob Alternative Ads integration in Android App. Show all posts

Monday, May 18, 2020

Facebook Native Banner Ads Integration in Android App | Admob Alternative Ad network

May 18, 2020 2 Comments
Hi, Today I am going to show you How to integrate Facebook Native Banner Ads in Android App. In the last post, I have shown you how to integrate Facebook Banner Ads in Android App. Let's start.


First, add the below dependency in build.gradle(Module: App) for importing Facebook ads SDK.


Code:




And then move to the activity_main.xml file, then paste the below layout code.




Code:


It will show your ad bottom of the screen if you want to show your ad Top of the screen you need to write android:layout_alignParentBottom="true". 

Then you have to create a new layout for your Native Banner Ad, named it native_banner_ad_layout.xml 



Then paste the below code in native_banner_ad_layout.xml file.


Code:


So the final full code will be in activity_main.xml file is as follows:


Code:





Now move to the MainActivity.java file, first import the Facebook ads SDK write the following code.


Code:


Then paste the below code above Oncreate.


Code:


Now initialize the Facebook SDK in Oncreate.

Code:


Then create NativeBannerAd object, set an AdListener, then retrieve the "Native Banner Ad's" properties and display it in onAdLoaded() method. It will display the ad once it is loaded successfully. After that call loadAd() after AdListener in your Activity as follows.



Code:


Then paste the following code in your activity after Oncreate.


Code:


So the final code will be in your java activity file is as follows:



Code:


Now if you run your App you will see the Native Banner ad.





That's it. Thank you.

Sunday, May 17, 2020

Facebook Interstitial Ads Integration in Android App | Admob Alternative Ad network

May 17, 2020 0 Comments
Hi, Today I am going to show you How to integrate Facebook Interstitial Ads in the Android app.
In the next post, I will show you How to integrate Facebook Native banner Ads in the Android app.


First, add the below dependency in build.gradle(Module: App) for importing Facebook ads SDK.


Code:




And then move to the MainActivity.java file, take an InterstitialAd variable called interstitialAd.





After that, you have to initialize the SDK in Oncreate.








And then need to initialize that  InterstitialAd variable with your Interstitial Placement ID. Then load an ad.


Code:


Then you can setAdListener and call interstitialAd.show for showing your Interstitial Ad.


Code:




Then you call loadad() for loading an interstitial ad.



That's it. After publishing your app in the google play store, you will see your Interstitial ad is showing in your app. Thank you.

Buy traffic for your website

Saturday, April 25, 2020

Facebook Banner Ads Integration in Android App Part 2 | Admob Alternative Ad network

April 25, 2020 1 Comments
Hi Everyone, Today I am going to show you how to integrate Facebook SDK and Banner ads in the android app in the android studio.

In the Last post, I have shown how to create a Facebook business account for monetization android app. Also, we have added our app on Facebook, Added payment method, and created a banner ad unit. If you have not followed my Facebook Banner Ads integration in Android App Part 1 yet, then first complete part 1 then come to follow this post part 2. So let's start.


First, open your project with Android studio, Then go to your "build.gradle(Module: App)" file, then paste below facebook ad network dependency in the dependencies section.


Code:


Now in the "MainActivity.xml" file initialize the Facebook Ad network SDK.

Code:



Then move to the layout file "activity_main.xml" file and paste the below code, if you want to show your ads in the top of the page then paste this code above, and if you want to show your ads in the bottom of the page then paste below code bottom in the "activity_main.xml" file.



Code:


Now go to the "MainActivity.java" file, then take an AdView private variable
Code:


Then you need to paste the below code after initializing SDK code below:


Code:


To get test ads, add "IMG_16_9_APP_INSTALL#" to your placement id. Remove this when your app is ready to serve real ads.

Now you can run your project on Emulator or on your real devices. You can see there will be test ads.

if you want to run your project on Emulator, then add the below line. You will get the hashed ID that is printed to logcat when you first make a request to load an ad on a device.

Code:


After testing done, you need to remove that line also. So, before going to live your final code will be


That's it, We have successfully integrated Facebook Ads in our App. If you face any problem in coding, you can comment below. We will try our best to help you. Thank you.

Tuesday, April 21, 2020

Facebook Banner Ads integration in Android App Part 1 | Admob Alternative Ad network

April 21, 2020 0 Comments
Hi Everyone, is your AdMob account disabled or terminated? Don't worry you can use Admob alternative ad network like Applovin, Facebook, Unity, Leadbolt. I show you how to integrate these all Admob alternative ads in the android app.

Today I am going to you how to create a Facebook business account for managing monetization on the android app, Also how to add your first app in Facebook Ad Network for monetizing.

For Better understanding watch the below video and follow my step. And if you want to get more new helpful video please subscribe to my youtube channel. Let's start.



First, you need to go developers.facebook.com Then click on Login, if your computer has already logged in Facebook, then it will automatically create your Facebook developer account.



After that, you can see above have a drop-down button called "MyApps", click on that. You can see there will appear "Create app", click on that.



Then the "Create a New App ID" window will appear. There you have to give a name for app id, then contact email. After that click on "Create App ID". Then it will ask you a captcha security check.



Now your developer account and app id created. And you will see the window like the below picture. you can see in your window have an Audience Network setup option, click on "set up".


After click on "set up", Start Monetizing now this page will open. you need to click on the "Get Started" button.


if your Facebook account has already a business manager account then it will ask you to login with that account. 
For doing that you have to just select your business manager account, then click on "Next".


And you if don't have any Business account manager, in that case, click on "Create New Account". 


After that, It will show continue with your developer account. Click on the "Continue" button.



it will give you a form, there you have to fill Name, Email, Business Name, Country. After filling done, click on the "Next" button.


Then it will ask you to add your first app. There you have to write your app name. then click on the "Next" button.



After that you have to enter in your Gmail, Facebook will be sent you an email. You need to click on the "Confirm Now" button.



After that, you have to choose the platform. As my app is Android, so I will choose Android.


Then you will see there have two options, one is "App is live", another one is "App is not live". If you are already published in the google play store, then you need to enter your app URL, then click on the search icon.it will show your app. If your app has not published yet, then select "App is not live". But after published your app, you also need to enter your app URL. After that click on the "Submit" button. See the below image.



Now you can see your app is in Review, it will take 2-3 days to approve. The first step is completed, Now the second step is Ad format chooses, you can see there have Native, Native Banner, Banner, Interstitial, Banner, Medium Rectangle.


I will choose "Banner" Because I will integrate the Banner ad in my app. After selecting the ad format, you need to write a name for your banner ad unit id. I am giving the name "Banner". After that click on the "Create Placement" button. 


1st and 2nd step is successfully completed. For the third step, you need to click on that checkbox.


4th step: In the 4th step, you need to add your payment account. Click on the "Add Payment account" button". 


It will show you a form, you have to fill it. select account type "Individual", fill your country, address, phone number, etc. After filling the full form, click on the "Next" button.


Now this time you have to link your bank account. Fill the link bank form also. After that click on "Next".


After that, they will ask you to Review your Details. After reviewing click on the "Confirm" button.


Now you will see you are all set.


Now select your payment account, which you have just created. After that, click on the "Select " button.


So we have finished all the steps. 


In the next post, I will show you How to integrate Facebook Banner Ads in Android App. Thank you.

Friday, April 17, 2020

How to Integrate Admob ads in Webview| Webview App Development Series Part 13

April 17, 2020 7 Comments
Hi Everyone, Our Webview App Development Series almost completed. We have added all the basic functionality in our App. Now we will add Admob ads in our Webview app. So that we can earn from our App. Last post I have shown you How to create an Admob account. If you don't have an Admob account, you can follow my last post.

By the way, Today I will show you how to create ad units in Admob and also how to integrate ads in our Webview App. Let's Start.


First we will go to Admob. Then click on the "Sign in" button. And then login to your Admob account.


Then you need to click on "Apps" from the left menu bar. Then click on 


Then it will ask you, have you published your app on Google Play or the App store? If your App is already published then click on Yes. After that, you can see below the image you need to enter your app name, developer name or app id.  Then click on the Search button. It will show your app, then click on ADD App.


But we have not published our Webview App yet. So, we will click on "No". Then you need to write your app name, select platform 'Android or ios' app. Then click on the "ADD" button.




You will see it says Congrats! your app has been added to Admob. And they will give you an App Id. Later we will implement this App ID in our project.



Now you need to click on "Create Ad Unit", It will show you ad format like Banner, Interistials, Reward, Native Advanced. I am going to Choose Banner ads. Click on "Select".


Then you need to give a name for the ad unit name. I am writing Banner. Then click on "Create AD UNIT"



Now you will see the below image, We have added our app, also have created an ad unit. Now we will copy APP ID and Ad unit id and paste it in a text file for easy to use.




We have done everything in AdMob, Now we will move to the android studio for implementing Admob ad in our project. For doing that, First, we need to integrate SDK in our project, you can do it in 2 ways, One is using dependencies, another one is Manual Download.

I will use dependencies to integrate SDK in Webview App, First, you need to go build.gradle(Module: App),then paste below dependency.

Code:
After that click on "Sync Now".

Now move to the "AndroidManifest.xml" file. And paste the below code inside the Application tag.

Code:



Example:

Now go to "activity_main.xml" file, and then paste below code, this code is for ads layout.

Code:




I have used test ads Ad unit id. You should not test app with your real ad unit id, for testing purposes you should always test with test ads. Otherwise Admob can banned your Admob Account.

Before Build your App for publishing in Google Play Store, don't forget to replace "test ad unit id" with your real ad unit id. Otherwise Admob will only serve test ads in your app and you will not get any revenue.

Example:


After that go to "MainActivity.java" file. Now you need to take a variable first "adview".

Code:



Now copy the below code and paste it in your "MainActivity.java" file in onCreate.

Code:


Example image:




That's it. We have finished the coding. Now you can run your project. As you can see below screenshot My app is showing test ads. So we have successfully integrated Admob Ad in our Webview App. Thank you.

Tuesday, April 14, 2020

How to Create an Admob Account in 2020

April 14, 2020 0 Comments
Hi Everyone, Today I will show you How to Create an Admob Account in 2020. 



 First, you need to enter Admob. Then you will see two buttons there one is Sign in Another one is Sign up.

As we are going to create an account. So we need to click on the Sign up button.



After click sign up button, it will ask you to enter your Gmail Account. You need to enter your Gmail which doesn't have an Admob account.


Then you need to enter your Gmail password. Then click on the "Next" button.


After that you will see it says "Welcome to admob signup". Also give you a form, there you need to select your "country", "time zone", and billing "currency". 

You can select currency as USD or your country currency. This billing currency means which currency you want to withdraw. Then you need to click on the checkbox.



After that you need to click on the "Create Admob Account" button.


That's it. You have successfully created your Admob account. Thank you.