Banners will be rendered using the HyBid SDK.


  • Ad Zone Id from the PubNative Publisher Dashboard

Code sample

You can find a demo app with code samples for this type of integration here.

Create XML layout

Create a HyBidBannerAdView inside your layout file


Create an attribute to hold the reference to the UI element.

private HyBidBannerAdView mBanner;

Get a reference to it from your code.

mBanner = findViewById(;

Requesting and displaying the ad

Use the load method to request an ad using the zone id and setting a listener for the banner.

private void loadBanner() {
    mBanner.load("ZONE_ID", new PNAdView.Listener() {
        public void onAdLoaded() {

        public void onAdLoadFailed(Throwable error) {


        public void onAdImpression() {


        public void onAdClick() {


Once the ad is loaded successfully from the server, the HyBidBannerAdView will render it and notify when it's ready via the onAdLoaded callback. Any error during fetch or rendering will be received via the onAdLoadFailed callback.

onAdImpression and onAdClick just notify of clicks and impressions. No code needs to be added there. Use those callbacks in case you want to hide the ad after click or some similar use case.

Finally destroy the banner when the activity or fragment are destroyed

public void onDestroy() {
    if (mBanner != null) {