Banner ads are classic static banners, which are usually located at the bottom or top of the advertisement.

Appodeal supports traditional 320x50 banners, tablet banners 728x90 and smart banners that adjust to the size and orientation of the device.

You can display only one view for banner on the screen.

1. Display banner at the specific position of the screen, Appodeal.BANNER_BOTTOM); // Display banner at the bottom of the screen, Appodeal.BANNER_TOP);    // Display banner at the top of the screen, Appodeal.BANNER_LEFT);   // Display banner at the left of the screen, Appodeal.BANNER_RIGHT);  // Display banner at the right of the screen

SDK can't show ads without a network connection! returns a boolean value indicating whether the show method call was passed to the appropriate SDK. 

2. Display banner in the specified view in the layout file

Add to your layout file:

	android:visibility="gone" />
Set view id before the SDK initialization to show banner in:
Now you can show the banner in the view specified (Make sure that the required view is on the screen):, Appodeal.BANNER_VIEW);


Custom BannerView should be on the top of the hierarchy and can not be overlapped by other views.

3. Display banner in programmatically created view

Create banner view:

Add view to your layout and then show banner in it:, Appodeal.BANNER_VIEW);

4. Check if a banner is loaded


5. Use banner callbacks

Appodeal.setBannerCallbacks(new BannerCallbacks() {
  public void onBannerLoaded(int height, boolean isPrecache) {
    // Called when banner is loaded
  public void onBannerFailedToLoad() {
    // Called when banner failed to load
  public void onBannerShown() {
    // Called when banner is shown
  public void onBannerShowFailed() {
    // Called when banner show failed
  public void onBannerClicked() {
    // Called when banner is clicked
  public void onBannerExpired() {
    // Called when banner is expired

All callbacks are called on the main thread.

6. Activity "Paused" state handling

We’ll automatically handle pause and resume state for already displayed Banners on Activity on which they were displayed, however, we don’t restore displayed Banners after Activity recreation (e.g. - orientation changes) and we don’t show Banners in newly created Activities.
For display ads on newly created Activity just call method if required.

public void onResume() {
    super.onResume();, Appodeal.BANNER_TOP);

This behavior can be changed by calling Appodeal.setSharedAdsInstanceAcrossActivities(true)
(See more: Enable Shared View Ads Instance Across Activities Logic)

7. Hide banner

Appodeal.hide(this, Appodeal.BANNER);

8. Destroy shown banner

If you want to hide the banner from all activities and clear the memory, call the code below:


9. Cache banner manually

To disable automatic caching for banners, use the code below before the SDK initialization:

Appodeal.setAutoCache(Appodeal.BANNER, false);
To cache banners, use:
Appodeal.cache(this, Appodeal.BANNER);
Read more on manual caching in our FAQ.

10. Configuration

10.1. Enable 728*90 banners

To enable 728*90 banners, use the following method:


10.2. Disable banner refresh animation

To disable banner refresh animation, use:


10.3. Disable smart banners

Smart banners are the banner ads that automatically fit the screen size. Using them helps to deal with the increasing fragmentation of the screen sizes on different devices. In the Appodeal SDK, the smart banners are enabled by default. To disable them, use the following method:


11. Check if the banner was initialized

To check if banner was initialized, you can use the method:

Appodeal.isInitialized(activity, Appodeal.BANNER);
Returns true, if the banner was initialized.

12. Check if autocache is enabled for banner

To check if autocache is enabled for banner, you can use the method:

Appodeal.isAutoCacheEnabled(activity, Appodeal.BANNER);
Returns true, if autocache is enabled for banner.

13. Get predicted eCPM for banner

To get the predicted eCPM from the next block in the caching queue, use the method:


This method is reasonable to use if manual caching of ads is enabled.

14. Enable Shared View Ads Instance Across Activities Logic

Starting from SDK 2.8.1 Appodeal SDK binds the Banner/MREC to the Activity which was passed to the method.

To make it easier for you to manage View ads display logic across all Activities we added a new method in Appodeal class:

Appodeal.setSharedAdsInstanceAcrossActivities(boolean sharedAdsInstanceAcrossActivities); // Default - false
  • When this method is used with the true parameter, the SDK will show AdView on all new activities without calling additional code from your side.
  • If you want to control the display yourself, you can call the method with the false parameter.

In this case, this parameter is false, be careful with changing orientation or moving to a new activity, the banner/MREC will not be shown automatically, since it was bound to the previous activity.
If you want to hide the banner/MREC, you need to call the Appodeal.hide() method with the parameters of the activity to which the banner/MREC was bound.

You can also check the current state of this logic. By default value is false: