Package 

Object CloudX


  • 
    public class CloudX
    
                        

    Main entry point for the CloudX SDK.

    This object provides functions to initialize the SDK, create ad units, configure logging, and manage user privacy settings.

    • Method Detail

      • isInitialized

         final static Boolean isInitialized()

        Returns whether the SDK has been successfully initialized.

      • initialize

         final static Unit initialize(CloudXInitializationConfiguration configuration, CloudXInitializationListener listener)

        Initializes the CloudX SDK. Must be called before loading or displaying any ads.

        Parameters:
        configuration - Configuration parameters including the SDK key and test mode settings.
        listener - Optional callback to receive initialization success or failure events.
      • createBanner

         final static CloudXAdView createBanner(String adUnitId)

        Creates a standard banner (320x50) ad view.

        Parameters:
        adUnitId - The ad unit ID configured in the CloudX dashboard.
      • createMREC

         final static CloudXAdView createMREC(String adUnitId)

        Creates an MREC (300x250) ad view.

        Parameters:
        adUnitId - The ad unit ID configured in the CloudX dashboard.
      • createInterstitial

         final static CloudXInterstitialAd createInterstitial(String adUnitId)

        Creates an interstitial ad for displaying fullscreen non-rewarded ads.

        Parameters:
        adUnitId - The ad unit ID configured in the CloudX dashboard.
      • createRewarded

         final static CloudXRewardedAd createRewarded(String adUnitId)

        Creates a rewarded ad for displaying fullscreen rewarded ads.

        Parameters:
        adUnitId - The ad unit ID configured in the CloudX dashboard.
      • setHashedUserId

         final static Unit setHashedUserId(String hashedUserId)

        Sets a hashed user identifier for ad targeting.

        Parameters:
        hashedUserId - A pre-hashed user identifier.
      • setUserKeyValue

         final static Unit setUserKeyValue(String key, String value)

        Sets a custom key-value pair for user-level targeting.

        Parameters:
        key - The key identifier for the targeting parameter.
        value - The value associated with the key.
      • setAppKeyValue

         final static Unit setAppKeyValue(String key, String value)

        Sets a custom key-value pair for app-level targeting.

        Parameters:
        key - The key identifier for the targeting parameter.
        value - The value associated with the key.
      • clearAllKeyValues

         final static Unit clearAllKeyValues()

        Clears all custom key-value pairs for both user and app-level targeting.

      • setHasUserConsent

         final static Unit setHasUserConsent(Boolean hasUserConsent)

        Sets the GDPR user consent flag for publishers not using a CMP.

        This is a fallback: if IAB consent strings (GPP/TCF) are present in SharedPreferences, they take priority over this manual flag.

        The value is forwarded to all network adapter privacy handlers immediately. Should be called before SDK initialization.

        Parameters:
        hasUserConsent - true if user has given consent, false if denied, null to clear.
      • setDoNotSell

         final static Unit setDoNotSell(Boolean isDoNotSell)

        Sets the CCPA do-not-sell flag for publishers not using a CMP.

        This is a fallback: if IAB consent strings (GPP/US Privacy) are present in SharedPreferences, they take priority over this manual flag.

        The value is forwarded to all network adapter privacy handlers immediately. Should be called before SDK initialization.

        Parameters:
        isDoNotSell - true if user opted out of sale, false if not, null to clear.