-
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(Context context, CloudXInitializationConfiguration configuration, CloudXInitializationListener listener)Initializes the CloudX SDK. final static CloudXAdViewcreateBanner(Context context, String adUnitId)Creates a standard banner (320x50) ad view. final static CloudXAdViewcreateMREC(Context context, String adUnitId)Creates an MREC (300x250) ad view. final static CloudXInterstitialAdcreateInterstitial(Context context, String adUnitId)Creates an interstitial ad for displaying fullscreen non-rewarded ads. final static CloudXRewardedAdcreateRewarded(Context context, String adUnitId)Creates a rewarded ad for displaying fullscreen rewarded ads. final static CloudXNativeAdLoadercreateNativeAdLoader(Context context, String adUnitId)Creates a native ad loader for loading and managing native ads. final static Unitarbiter(CloudXArbiterConfiguration configuration, CloudXArbiterListener listener)Runs a loaded CloudX bid against one or more publisher-supplied bids. 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(Context context, CloudXInitializationConfiguration configuration, CloudXInitializationListener listener)
Initializes the CloudX SDK. Must be called before loading or displaying any ads.
- Parameters:
context- Android context (Activity or Application).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(Context context, 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(Context context, String adUnitId)
Creates an MREC (300x250) ad view.
- Parameters:
adUnitId- The ad unit ID configured in the CloudX dashboard.
-
createInterstitial
final static CloudXInterstitialAd createInterstitial(Context context, String adUnitId)
Creates an interstitial ad for displaying fullscreen non-rewarded ads.
- Parameters:
context- This parameter is reserved for future use.adUnitId- The ad unit ID configured in the CloudX dashboard.
-
createRewarded
final static CloudXRewardedAd createRewarded(Context context, String adUnitId)
Creates a rewarded ad for displaying fullscreen rewarded ads.
- Parameters:
context- This parameter is reserved for future use.adUnitId- The ad unit ID configured in the CloudX dashboard.
-
createNativeAdLoader
final static CloudXNativeAdLoader createNativeAdLoader(Context context, String adUnitId)
Creates a native ad loader for loading and managing native ads.
- Parameters:
context- This parameter is reserved for future use.adUnitId- The ad unit ID configured in the CloudX dashboard.
-
arbiter
final static Unit arbiter(CloudXArbiterConfiguration configuration, CloudXArbiterListener listener)
Runs a loaded CloudX bid against one or more publisher-supplied bids.
The SDK submits the configured bids to the Trusted Arbiter and returns the selected platform through CloudXArbiterListener. If that request fails, the SDK falls back to the highest plaintext bid supplied to configuration. Supported V0 bid inputs are expected to provide comparable USD arbiter values for this fallback path.
-
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.
Can be called before or after SDK initialization. Post-init, the value is forwarded to adapter privacy handlers automatically via ManualPrivacyState.onChanged.
- 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.
Can be called before or after SDK initialization. Post-init, the value is forwarded to adapter privacy handlers automatically via ManualPrivacyState.onChanged.
- Parameters:
isDoNotSell- true if user opted out of sale, false if not, null to clear.
-
-
-
-