1. Enable test mode

Test mode allows you to show our test ads with 100% fillrate.

Appodeal.setTesting(true);

Should be called before the SDK initialization.

2. Enable logging

To enable debug logging, use the code below:

Appodeal.setLogLevel(Log.LogLevel.debug);
Logs will be written to logcat using the Appodeal tag.

Available parameters:

  • Log.LogLevel.none - logs off;
  • Log.LogLevel.debug - debug messages;
  • Log.LogLevel.verbose  - all SDK and ad network messages.

3. Disable networks

Appodeal.disableNetwork(this, AppodealNetworks.NETWORK);
You can find all available networks in AppodealNetworks.

Important

Should be called before the SDK initialization.

4. Disable networks for specific ad types

Appodeal.disableNetwork(this, AppodealNetworks.NETWORK, adTypes);
Example:
Appodeal.disableNetwork(this, AppodealNetworks.ADMOB, Appodeal.BANNER | Appodeal.INTERSTITIAL);
Should be called before the SDK initialization.

5. Request Android M permissions

To request "WRITE_EXTERNAL_STORAGE" and "ACCESS_COARSE_LOCATION" permissions on Android M and higher, call the following method:

Appodeal.requestAndroidMPermissions((Activity) this, new PermissionsHelper.AppodealPermissionCallbacks(){
  @Override
  public void writeExternalStorageResponse(int result) {
    if (result == PackageManager.PERMISSION_GRANTED) {
      Utils.showToast((Activity) MainActivity.this, "WRITE_EXTERNAL_STORAGE permission was granted");
    } else {
      Utils.showToast((Activity) MainActivity.this, "WRITE_EXTERNAL_STORAGE permission was NOT granted");
    }
  }

  @Override
  public void accessCoarseLocationResponse(int result) {
    if (result == PackageManager.PERMISSION_GRANTED) {
      Utils.showToast((Activity) MainActivity.this, "ACCESS_COARSE_LOCATION permission was granted");
    } else {
      Utils.showToast((Activity) MainActivity.this, "ACCESS_COARSE_LOCATION permission was NOT granted");
    }
  }
});

6. Disable location permission check

To disable toast message "ACCESS_COARSE_LOCATION permission is missing", use the following method before the SDK initialization:

Appodeal.disableLocationPermissionCheck();

7. Disable write external storage permission check

To disable toast-messages "WRITE_EXTERNAL_STORAGE permission is missing", use the following method before the SDK initialization:

Appodeal.disableWriteExternalStoragePermissionCheck();

This method disables all networks that need this permission which may lead to low video fill rate.

8. Test third-party networks adapters integration

To start test activity for testing adapters integration, call:

Appodeal.startTestActivity((Activity) this);

9. Disable data collection for kids apps

Appodeal.setChildDirectedTreatment(true);

10. Check if ad type was initialized

Appodeal.isInitialized((Activity)this, adType);
Returns true, if the ad type was initialized.

11. Check if autocache is enabled for ad type

Appodeal.isAutoCacheEnabled((Activity)this, adType);
Returns true, if auto cache is enabled for this ad type.

12. Mute videos if call volume is muted

Appodeal.muteVideosIfCallsMuted(true);

13. Send extra data

You can send key-value data to Appodel. There is the predefined key ExtraData.APPSFLYER_ID.

public static void setExtraData(@NonNull String key, @NonNull String value)
public static void setExtraData(@NonNull String key, int value)
public static void setExtraData(@NonNull String key, double value)
public static void setExtraData(@NonNull String key, boolean value)
public static void setExtraData(@NonNull String key, @NonNull JSONObject value)

14. Get predicted eCPM by ad type

For all ad types excluding native ads:

public static double getPredictedEcpm(final int adTypes);
For native ad there is a method in NativeAd interface:
double getPredictedEcpm();