CloudX Android SDK
Automated Integration with Claude Code
Integrate CloudX SDK in 15 minutes with AI-powered agents: Requires Claude Code.- First-look CloudX with automatic fallback to existing ad setup
- Privacy compliance validation (GDPR, CCPA)
- Build verification catches errors early
- Preserves existing ad setup as backup
Manual Installation
Requires Android API 23+ and Java 8+. Add the CloudX SDK to your app’s build.gradle:Initialization
Ad Integration
Banner Ads (320x50)
MREC Ads (300x250)
Interstitial Ads
Rewarded Ads
Ad Information (CloudXAd)
TheCloudXAd object is passed to listener callbacks and contains information about the loaded/displayed ad:
| Property | Type | Description |
|---|---|---|
adFormat | CloudXAdFormat | Ad format (BANNER, MREC, INTERSTITIAL, REWARDED) |
adUnitId | String | The ad unit ID |
networkName | String | Name of the winning ad network |
networkPlacement | String? | Network-specific placement ID |
placement | String? | Custom placement set via setPlacement() |
revenue | Double | Impression-level revenue in USD |
Error Handling
All SDK errors are returned asCloudXError objects in listener callbacks:
| Property | Type | Description |
|---|---|---|
code | CloudXErrorCode | Error category |
message | String | Human-readable description |
cause | Throwable? | Optional underlying exception |
formattedMessage | String | Pre-formatted message including code and description |
Error Code Categories
| Range | Category | Common Codes |
|---|---|---|
| 0 | General | INTERNAL_ERROR |
| 100-199 | Network | NETWORK_ERROR, NETWORK_TIMEOUT, NETWORK_SERVER_ERROR, NETWORK_NO_CONNECTION |
| 200-299 | Initialization | NOT_INITIALIZED, SDK_DISABLED, NO_ADAPTERS_FOUND, INVALID_APP_KEY |
| 300-399 | Ad Loading | NO_FILL, INVALID_AD_UNIT, ADS_DISABLED |
| 400-499 | Display | AD_NOT_READY, AD_ALREADY_SHOWING |
| 600-699 | Adapter | ADAPTER_NO_FILL, ADAPTER_TIMEOUT, ADAPTER_LOAD_TIMEOUT, ADAPTER_INITIALIZATION_ERROR |
Advanced Features
Debug Logging
VERBOSE < DEBUG < INFO < WARN < ERROR < NONE
Filter logcat with tag CloudX to see SDK logs.
Impression-Level Revenue Tracking
Set arevenueListener on any ad format to receive impression-level revenue (ILR) callbacks. The CloudXAd object contains the revenue value in USD and the winning network name.
Test Mode
Test mode is server-controlled via device whitelisting. This provides better security and control over which devices receive test ads. To enable test mode:-
Initialize the SDK and check logcat for your device advertising ID:
- Copy the advertising ID and add it to your device whitelist on the CloudX server dashboard
- The SDK will automatically configure adapters for test mode and include the test flag in bid requests
Privacy Compliance
The CloudX SDK supports GDPR and CCPA privacy compliance by reading standard IAB privacy strings from SharedPreferences. These values are typically set automatically by your Consent Management Platform (CMP) such as Google UMP, OneTrust, or Sourcepoint.How It Works
The SDK automatically detects user location and reads consent signals:- EU Users (GDPR): Checks TCF v2 consent for purposes 1-4 and vendor consent (CloudX Vendor ID: 1510)
- US Users (CCPA): Checks for sale/sharing opt-out signals
- Other Regions: No restrictions applied
- Advertising ID (GAID) is cleared
- Geo coordinates (lat/lon) are removed
- User key-values are not sent
- Hashed user ID is excluded
Supported Privacy Keys
| Key | Standard | Description |
|---|---|---|
IABGPP_HDR_GppString | GPP | Global Privacy Platform string (modern) |
IABGPP_GppSID | GPP | Section IDs (e.g., “2” for EU, “7” for US-National, “8” for US-CA) |
IABTCF_TCString | TCF v2 | GDPR consent string (legacy) |
IABTCF_gdprApplies | TCF v2 | Whether GDPR applies (1 = yes, 0 = no) |
IABUSPrivacy_String | US Privacy | CCPA privacy string (legacy, e.g., “1YNN”) |
Note: The SDK prioritizes GPP (modern standard) over legacy TCF/US Privacy strings when both are available.