The Android Developer Challenge is back! Submit your idea before December 2.

AdvertisingIdProviderManager

public class AdvertisingIdProviderManager
extends Object

java.lang.Object
   ↳ androidx.ads.identifier.provider.AdvertisingIdProviderManager


The AdvertisingIdProviderManager will be used by an Advertising ID Provider to register the provider implementation or retrieve all the Advertising ID Providers on the device. This package contains an implementation of the Advertising ID Provider Service that supports IAdvertisingIdService.aidl for communication with the developer library, allowing you to easily make your own Advertising ID Provider. Simply do the following:

  1. Implement the AdvertisingIdProvider interface in the provider library. Developer apps will be interacting with the provider through this programmatic interface.
  2. Register the implementation by calling registerProviderCallable(Callable) within the provider’s Application.onCreate() callback.
  3. Register the Advertising Id settings UI with the intent filter "androidx.ads.identifier.provider.OPEN_SETTINGS".

Summary

Public methods

static List<AdvertisingIdProviderInfo> getAdvertisingIdProviders(Context context)

Retrieves a list of all the Advertising ID Providers' information on this device, including self and other providers which is based on the AndroidX Advertising ID Provider library.

static void registerProviderCallable(Callable<AdvertisingIdProvider> providerCallable)

Registers the Callable to create an instance of AdvertisingIdProvider.

Inherited methods

Public methods

getAdvertisingIdProviders

public static List<AdvertisingIdProviderInfo> getAdvertisingIdProviders (Context context)

Retrieves a list of all the Advertising ID Providers' information on this device, including self and other providers which is based on the AndroidX Advertising ID Provider library.

This method helps one Advertising ID Provider find other providers. One usage of this is to link to other providers' settings activity from one provider's settings activity, so the user of the device can manager all the providers' settings together.

Parameters
context Context

Returns
List<AdvertisingIdProviderInfo>

registerProviderCallable

public static void registerProviderCallable (Callable<AdvertisingIdProvider> providerCallable)

Registers the Callable to create an instance of AdvertisingIdProvider.

This is used to lazy load the AdvertisingIdProvider when the Service is started.

This Callable will be called within the library's built-in Advertising ID Service's Service.onCreate() method.

Provider could call this method to register the implementation in Application.onCreate(), which is before Service.onCreate() has been called.

Parameters
providerCallable Callable