-
public class CloudXMain 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 Summary
Modifier and Type Method Description final static StringgetVersion()Returns the current SDK version. final static BooleanisInitialized()Returns whether the SDK has been successfully initialized. final static Unitinitialize(CloudXInitializationConfiguration configuration, CloudXInitializationListener listener)Initializes the CloudX SDK. final static CloudXAdViewcreateBanner(String adUnitId)Creates a standard banner (320x50) ad view. final static CloudXAdViewcreateMREC(String adUnitId)Creates an MREC (300x250) ad view. final static CloudXInterstitialAdcreateInterstitial(String adUnitId)Creates an interstitial ad for displaying fullscreen non-rewarded ads. final static CloudXRewardedAdcreateRewarded(String adUnitId)Creates a rewarded ad for displaying fullscreen rewarded ads. final static UnitsetMinLogLevel(CloudXLogLevel minLogLevel)Sets the minimum log level for SDK logging output. final static UnitsetHashedUserId(String hashedUserId)Sets a hashed user identifier for ad targeting. final static UnitsetUserKeyValue(String key, String value)Sets a custom key-value pair for user-level targeting. final static UnitsetAppKeyValue(String key, String value)Sets a custom key-value pair for app-level targeting. final static UnitclearAllKeyValues()Clears all custom key-value pairs for both user and app-level targeting. final static UnitsetHasUserConsent(Boolean hasUserConsent)Sets the GDPR user consent flag for publishers not using a CMP. final static UnitsetDoNotSell(Boolean isDoNotSell)Sets the CCPA do-not-sell flag for publishers not using a CMP. -
-
Method Detail
-
getVersion
final static String getVersion()
Returns the current SDK version.
-
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.
-
setMinLogLevel
final static Unit setMinLogLevel(CloudXLogLevel minLogLevel)
Sets the minimum log level for SDK logging output. Use CloudXLogLevel.NONE to disable all logging.
- Parameters:
minLogLevel- The minimum CloudXLogLevel to display.
-
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.
-
-
-
-