Skip to content

Android Frequently Asked Questions

Overview

This document summarizes common issues and solutions when using UJU Android SDK, helping developers quickly troubleshoot and resolve problems.

Ad Loading and Display

Q: Why isn't the ad displaying?

A: Possible reasons and solutions:

  1. Network connection issues

    • Check if the device network connection is normal
    • Try switching network types (Wi-Fi/mobile network)
    • Check if the firewall is blocking network requests
  2. Ad unit ID error

    • Confirm if the ad unit ID is correct
    • Check if the ad unit ID is correctly configured in UJU backend
    • Ensure you're using the correct ad unit ID for the corresponding platform (Android/iOS)
  3. SDK initialization issues

    • Confirm if the SDK is correctly initialized
    • Check if App ID and App Key are correct
    • Check if the initialization callback returns success
  4. Insufficient ad inventory

    • Try using other types of ads
    • Check if ad network configuration is correct
    • Try again later, ad inventory may fluctuate
  5. Test device issues

    • Confirm if the test device ID has been added to the test device list
    • Check if test mode is correctly enabled
    • Try using a different test device

Q: What to do if ad loading fails with error code?

A: Refer to the Error Codes document to understand the specific error reason and solution.

Q: How to improve ad fill rate?

A: Recommendations for improving ad fill rate:

  1. Integrate multiple ad networks

    • Integrate both domestic and overseas ad networks
    • Reasonably configure ad source priority
  2. Optimize ad loading strategy

    • Load ads in advance, use preloading strategy
    • Implement ad caching mechanism
    • Set reasonable ad refresh intervals
  3. Improve app quality

    • Optimize app user experience
    • Increase app user activity
    • Increase app downloads and user base
  4. Compliance operation

    • Ensure the app complies with each ad network's policy requirements
    • Avoid fake traffic and invalid clicks
    • Maintain a good ad display environment

SDK Integration and Configuration

Q: What to do if SDK initialization fails?

A: Possible reasons and solutions:

  1. Network issues

    • Check if network connection is normal
    • Confirm the device can access UJU servers
  2. App ID/Key error

    • Confirm if App ID and App Key are correct
    • Check if you're using the correct app credentials
  3. Permission issues

    • Confirm the app has obtained necessary permissions
    • Check permission configuration in AndroidManifest.xml
  4. Version compatibility

    • Confirm SDK version is compatible with Android system version
    • Check if dependency library versions conflict

Q: How to add test devices?

A: Methods to add test devices:

  1. Add through code

    java
    // Add test device before initializing SDK
    UJUAd.addTestDevice("YOUR_TEST_DEVICE_ID");
  2. Get test device ID through logs

    • Run the app and check logs
    • When ad loading fails, the test device ID will be displayed in the logs
    • Copy the ID and add it to the test device list
  3. Get through settings

    java
    String testDeviceId = Settings.Secure.getString(getContentResolver(), Settings.Secure.ANDROID_ID);
    Log.d("TestDeviceID", "Device ID: " + testDeviceId);

Q: How to enable debug mode?

A: Method to enable debug mode:

java
// Enable debug mode when initializing SDK
UJUAdConfig config = new UJUAdConfig.Builder()
    .setAppId("YOUR_APP_ID")
    .setAppKey("YOUR_APP_KEY")
    .setDebugMode(true)  // Enable debug mode
    .build();

UJUAd.init(this, config, new InitCallback() {
    // Callback methods
});

Performance and Optimization

Q: Does ad loading affect app performance?

A: Ad loading may have some impact on app performance, recommendations:

  1. Optimize loading timing

    • Load ads when the app is idle
    • Avoid loading ads during frequent user interactions
    • Use asynchronous loading to avoid blocking the main thread
  2. Memory management

    • Timely destroy ad instances that are no longer used
    • Avoid memory leaks
    • Monitor app memory usage
  3. Network optimization

    • Implement network status detection
    • Reduce ad requests when network conditions are poor
    • Implement ad caching mechanism

Q: How to optimize ad loading speed?

A: Recommendations for optimizing ad loading speed:

  1. Preloading strategy

    • Preload ads at app startup
    • Load ads in advance before users might need them
    • Implement ad preloading queue
  2. Caching mechanism

    • Implement ad content caching
    • Cache ad materials and resources
    • Reduce duplicate network requests
  3. Network optimization

    • Use CDN to accelerate ad resource loading
    • Implement intelligent network selection
    • Optimize network request parameters
  4. Code optimization

    • Reduce main thread blocking
    • Optimize ad rendering logic
    • Use efficient data structures

Revenue and Monetization

Q: How to improve ad revenue?

A: Recommendations for improving ad revenue:

  1. Ad type selection

    • Rewarded video ads: Highest revenue, recommended for priority use
    • Interstitial ads: High revenue, suitable for display during user operation gaps
    • Native ads: Good user experience, suitable for integration with app content
    • Banner ads: Continuous display, suitable for long-term monetization
  2. Ad placement optimization

    • Choose locations with high user activity
    • Ensure ad locations are prominent but not disruptive to user experience
    • Test ad performance in different locations
  3. Ad display strategy

    • Set reasonable ad display frequency
    • Avoid over-displaying ads
    • Implement intelligent ad display strategy
  4. User targeting

    • Provide accurate user information
    • Implement user segmentation and targeted delivery
    • Optimize ad targeting parameters

Q: How is ad revenue calculated?

A: Ad revenue calculation methods:

  1. CPM (Cost Per Mille)

    • Revenue per thousand impressions
    • Calculation formula: CPM = (Total Revenue / Impressions) × 1000
  2. CPC (Cost Per Click)

    • Revenue per click
    • Calculation formula: CPC = Total Revenue / Clicks
  3. CPA (Cost Per Action)

    • Revenue per action
    • Calculation formula: CPA = Total Revenue / Actions
  4. Hybrid billing

    • Depending on ad type and ad network, hybrid billing methods may be used
    • Specific billing methods are subject to UJU backend configuration

Q: How to view ad revenue data?

A: Methods to view ad revenue data:

  1. UJU backend

    • Log in to UJU developer backend
    • Enter App Management → Data Analysis
    • View detailed revenue data and reports
  2. SDK callbacks

    • Get ad impression and click events through ad listeners
    • Implement custom statistics logic
    • Integrate with your app's data analysis system

Policy and Compliance

Q: What compliance issues need to be considered for ad display?

A: Ad compliance considerations:

  1. Ad identification

    • Ensure ads have clear identification
    • Avoid confusion between ads and app content
    • Add ad identification according to each ad network's requirements
  2. User experience

    • Avoid excessive user interruption
    • Ensure ads do not affect core app functions
    • Provide options to skip ads
  3. Content compliance

    • Ensure ad content complies with laws and regulations
    • Avoid displaying illegal ads
    • Regularly check ad content
  4. Data compliance

    • Comply with user data privacy protection regulations
    • Obtain explicit user authorization
    • Reasonably use user data

Q: How to avoid ads being considered invalid clicks?

A: Recommendations to avoid invalid clicks:

  1. Development phase

    • Use test ad unit IDs
    • Enable test mode
    • Avoid generating real clicks on development devices
  2. Production environment

    • Educate users not to maliciously click on ads
    • Avoid adding code that automatically clicks on ads in the app
    • Reasonably set ad display positions to avoid accidental clicks
  3. Monitoring and optimization

    • Monitor click data to detect anomalies in time
    • Analyze click behavior and optimize ad display strategy
    • Maintain communication with the UJU team

Technical Support

Q: How to get technical support when encountering issues?

A: Methods to get technical support:

  1. Official documentation

  2. Technical support

    • Send email to marco@ujuad.com
    • Submit a ticket in UJU backend
    • Join the developer communication group for real-time support
  3. Community resources

    • View common questions and solutions
    • Participate in developer community discussions
    • Share and gain development experience

Q: How to update SDK version?

A: Methods to update SDK version:

  1. Check changelog

    • Check Changelog to understand version changes
    • Confirm if the new version resolves the issues you encountered
    • Learn about new features and improvements in the new version
  2. Update dependencies

    • Update SDK version in build.gradle file
    • Sync project dependencies
    • Rebuild the app
  3. Testing and verification

    • Verify the new version in a test environment
    • Ensure all ad functions work normally
    • Check if there are API changes that need adaptation