Nimbus Android SDK

Requesting

Now that you've configured the Nimbus SDK within your project, you can begin to request ads. Ad requests are made up of JSON objects generated using the NimbusRequest class and NimbusAdManager.

Configure global request information

The NimbusAdManager can be configured globally to send information that applies to every request. The information will be added to the NimbusRequest object when NimbusAdManager.showAd(...) is called.

Session ID

A random UUID is generated for the Session ID when Nimbus is first initialized. The Session ID can be overridden with any unique string by calling NimbusAdManager.setSessionId("any_unique_session_id");

User information

We recommend adding any available User information using NimbusAdManager.setUser(). Calling setUser() multiple times will replace the User object with the new value.

NimbusAdManager.setUser(new AndroidUserBuilder(new User())
    .age(34).gender(User.FEMAlE).yearOfBirth(1985).user);

Ad Blocking

Currently, the Android SDK is able to handle dynamically injected Blocked Advertisers (badv).

NimbusAdManager.setBlockedAdvertiserDomains()

The Nimbus Dashboard provides a fully functional ad blocking UI that can block by Categories, Advertisers, and Apps - we recommend that all blocks take place at this level instead of at both the SDK and UI level. The UI should ALWAYS be the source of truth. Double blocking may result in unwanted loss in revenue.

We recommend that only advanced publishing partners utilize the dynamic blocking functionality within the SDKs, as having blocks in multiple channels will increase complexity and complications.

Notes

Create the NimbusRequest

The NimbusRequest class is an implementation of the OpenRTB BidRequest object that contains information about the type of ad that should be shown. We provide helper methods to automatically populate the request object with default values for a particular ad type.

Placement ID

The first parameter of each helper method defines the name of the placement as it will appear on the Nimbus Dashboard. We recommend using unique and descriptive names for each different ad unit to make it easier to measure the performance of different placements in your app.

Interstitial Ads

final NimbusRequest request = NimbusRequest.forInterstitialAd("interstitial_placement_id");

Nimbus supports multiple creative types for interstitial ad units. The helper method forInterstitialAd() will generate a request for both a video and display ad placement with the highest bidding creative type rendered on screen.

final NimbusRequest request = NimbusRequest.forBannerAd("banner_placement_id", Format.BANNER_320_50, Position.FOOTER));

The helper method forBannerAd will generate a request for a banner placement. The second parameter of the helper method defines the size of the requested banner while the third argument defines where it will appear on the screen. This is the recommended way to generate request for 320 by 50 banner ads and can also be used for other display ad sizes.

Make the Request

Finally, call NimbusAdManager.showAd() with your NimbusRequest, ViewGroup, and Renderer.Listener

This will return an AdController on a successful request. See how to interact with the AdController in the next step.

Next

Move on to Rendering.