Get Started with Avocarrot

Overview

Examples

Android

Overview

Getting Started

- Integrating Ads

Stream

Native Assets

Banner

Interstitial

Video

- Others

Troubleshooting

- Adapters

Admob Android Adapter

Mopub Android Adapter

iOS

Overview

Getting Started

- Integrating Ads

Stream

Native Assets

Banner

Interstitial

Video

- Others

Troubleshooting

- Adapters

Admob iOS Adapter

Mopub iOS Adapter

API Documentation

Reporting API

Help

Supported Networks & Ad Types

General

Earnings

Payments and Accounting

Integration

Reporting

Mediation Network Optimization

Legal and Privacy

Updates

SDK Change Log

Android Change Log

iOS Change Log

Video

Updated 2 months ago ​by Derek Lim

Overview

This tutorial helps you setup video ads in your Android app and receive your first ad.


Standard Video Ads are not yet supported in Avocarrot Exchange. You have to configure other 3rd party ad networks to get Video demand. Learn more about the supported ad networks and formats here.

Prerequisites

You need an Avocarrot account to complete the tutorial. Create an account
You need to create a Video ad unit for your app on your Avocarrot dashboard.
You need to setup the Avocarrot SDK. Setup SDK

Setup Video Ads

All SDK method calls should be done from the main thread (Main thread, UI thread).

ID of advertising space for testing : "032c0809-0335-4e98-8f8c-8e522f291d0f"

The ID above is meant for testing purpose only, please replace it with the Ad unit Id of your placement on dashboard.
  1. Add the following code to your activity:


    VideoAd videoAd = VideoAdPool.load(this, "YOUR_VIDEO_AD_UNIT_ID", closeButtonEnabled, 
    videoAdListener);

    The Close button for video ads is supported for some networks. You can enable or disable it by changing closeButtonEnabledparameter.

    If you call reloadAd() before the video has started to show, new request processing is cancelled. Only one request will be processed.

    When the video download is completed, you can display it by calling the showAd() method.


    videoAd.showAd();
    To learn about download completion, subscribe to video banner events (see Ad Events Handling) or call method isReady().


        videoAd.isReady();

  2. Activity lifecycle events handling

    onDestroy() method should be called depending on the activity lifecycle events.

    Example:
    @Override
    protected void onDestroy() {
        super.onDestroy();
        videoAd.onActivityDestroyed();
    }
    
  3. Congratulations! Compile and Run your project. You can now further customize your Video ads.

Advanced Customization

Go Live!

  1. Remove sandbox If you have received a sample ad then simply disable the Sandbox mode by including the following instruction in your code:
    Avocarrot.setTestMode(false);
    You should disable Sandbox mode ONLY when you are done with the integration and you are ready to publish your app. It is against Avocarrot's policies to use live ads during development, and doing so could get your Avocarrot account banned.
  2. Publish app You are now ready to upload your app and start making money! If you have submitted your app in the Google Play/ Apple Store and you can see live ads, then you have nothing to worry about. Just wait until the impressions threshold has been reached and the app will be shown as live in your dashboard as well.
  3. Update payment details. Login to your account and update your payment settings.



Was this article useful?