AdManager

class AdManager : AdManagerInternal, AdLoading, AdManagerListening, SlotAds

The main class for Richie Ads.

Use one of the create methods to create a new instance.

Important: only one instance of AdManager during the lifetime of the hosting application is supported.

Types

Link copied to clipboard
abstract class PersistentListener
Listener for loading events related to persistent ads.
Link copied to clipboard
interface SlotListener
Listener for loading events related to slot ads.

Functions

Link copied to clipboard
Adds a persistent listener, which provides callbacks for ad-related events.
Link copied to clipboard
Adds a listener, which gets notified when slot ads become available.
Link copied to clipboard
open fun create(@NonNull context: Context, @NonNull applicationIdentifier: String): AdManager
Creates a new AdManager instance which stores its data in internal storage.
open fun create(@NonNull context: Context, @NonNull applicationIdentifier: String, @NonNull dataDirLocation: StorageOption): AdManager
Creates a new AdManager instance, with an option to choose Ads' data storage location.
Link copied to clipboard
open fun deleteAd(@NonNull identifier: String, @NonNull containerDir: File)
Deletes an ad, along with its directory.
Link copied to clipboard
open fun deleteContainer(@NonNull containerDir: File)
Informs Richie that an ad container will be deleted.
Link copied to clipboard
open fun getAd(@NonNull identifier: String, @NonNull containerDir: File): Ad
Get an Ad object that can be used to configure an AdView.
Link copied to clipboard
open fun getPlaceholderImage(@NonNull slotAdFlight: SlotAdFlight, portrait: Boolean): Bitmap
open fun getPlaceholderImage(@NonNull identifier: String, @NonNull containerDir: File, portrait: Boolean): Bitmap
Retrieves a placeholder image (e.g.
Link copied to clipboard
open fun getRectForDrawingPlaceholderImage(@NonNull placeholderImage: Bitmap, @NonNull targetRect: Rect): Rect
Gets a Rect the placeholder image fits in.
Link copied to clipboard
open fun hasLoadedAd(@NonNull identifier: String, @NonNull containerDir: File): Boolean
Checks whether an ad has loaded.
Link copied to clipboard
open fun isLoadingAd(@NonNull identifier: String, @NonNull containerDir: File): Boolean
Checks whether an ad is currently loading.
Link copied to clipboard
open fun loadAd(@NonNull identifier: String, @NonNull url: URL, expectedLength: Long, @NonNull containerDir: File)
Starts loading an ad.
Link copied to clipboard
Tells Richie Ads that a page view has occurred in a slot.
Link copied to clipboard
Tells Richie Ads that a page view has occurred in multiple slots.
See nextFlightForSlots for details.
Link copied to clipboard
Removes a persistent listener.
Link copied to clipboard
Removes a slot listener.
Link copied to clipboard
open fun reset(@NonNull application: Application, @NonNull dataLocation: StorageOption, @NonNull appIdentifier: String)
Deletes all data files used by Richie Ads, including the RichieData dir and the event database.
Link copied to clipboard
Global persisted parameters can be used by ad creatives (using JavaScript API) to query global state.
Link copied to clipboard
open fun setUsesSlotAds()
Enables slot ads.