In recent years, Google released adaptive banners which are a replacement for the popular 320dp x 50dp banner ad and the smart banner.
You can calculate its height by SDK at runtime and can optimize the UI for the user. It only requires two steps to upgrade banner ads to adaptive banners.
Google AdMob is a powerful tool for monetizing cross-platform apps and websites. It also provides different ad types for displaying different UIs to users on mobile application.
Google AdMob uses banner ads, interstitial ads, native ads, and reward ads. In this blog, we explore the banner ad.
There are Four types of Google ads.
- Native
- Interstitial
- Banner
- Rewarded Video
1. Native ads: Native ads are for users' UI components as shown below.
Step 1.1: The below code is put in the manifest file.
Step 1.2: Create an activity_main.xml and below code put inside.
Step 1.3: MobileAds.initialize(this)
2. Interstitial: Interstitial ads are full-screen UI ads. The below code implements full-screen ads.
Step 2.1: Create a MainActivity.java file and put the below code.
3. Banner: Banner ads are a rectangular image or text that is included in the Screen UI. The below code implements Banner ads.
Step 3.1: Create an activity_main.xml and below code put inside.
Step 3.2: Create a MainActivity.java file and put the below code.
4. Rewarded Video: A rewarded video ad is a full screen video in an application also used in games. App reward when they watch the reward video from start to end.
Step 4.1: The below code is put in the manifest file.
Step 4.2: Create an activity_main.xml and below code put inside.
Step 4.3: Create a MainActivity.java file and put the below code.
Happy Coding!