package com.novoda.downloadmanager.demo.extended;

import android.app.Application;
import android.hardware.SensorManager;

import com.facebook.stetho.Stetho;
import com.novoda.downloadmanager.Download;
import com.novoda.downloadmanager.DownloadManagerBuilder;
import com.novoda.downloadmanager.lib.DownloadClientReadyChecker;
import com.novoda.downloadmanager.lib.DownloadManager;
import com.novoda.downloadmanager.lib.NotificationCustomiser;
import com.novoda.downloadmanager.lib.NotificationCustomiserProvider;
import com.novoda.notils.logger.simple.Log;

public class DemoApplication extends Application implements DownloadClientReadyChecker, NotificationCustomiserProvider {

    private OneRuleToBindThem oneRuleToBindThem;
    private NotificationCustomiser notificationCustomiser;

    @Override
    public void onCreate() {
        super.onCreate();
        notificationCustomiser = new DemoNotificationCustomiser(DemoApplication.this);
        oneRuleToBindThem = new OneRuleToBindThem();

        Stetho.initializeWithDefaults(this);

        Log.setShowLogs(true);

        Log.d("Test, DemoApplication sanity check download manager and force start");
        DownloadManager downloadManager = DownloadManagerBuilder.from(this).build();
        downloadManager.sanityCheckBatchStatuses();
        downloadManager.forceStart();



    }

    @Override
    public boolean isAllowedToDownload(Download download) {
        // Here you would add any reasons you may not want to download
        // For instance if you have some type of geo-location lock on your download capability
        return oneRuleToBindThem.shouldWeDownload(download);
    }

    @Override
    public NotificationCustomiser getNotificationCustomiser() {
        return notificationCustomiser;
    }

    private static final class OneRuleToBindThem {

        /**
         * @return for our demo we expect always to return true ... unless you want to conquer the galaxy
         */
        public boolean shouldWeDownload(Download download) {
            return download.getTotalSize() > SensorManager.GRAVITY_DEATH_STAR_I;
        }
    }

}

package com.novoda.downloadmanager.demo.extended;

import android.app.Application;
import android.hardware.SensorManager;

import com.novoda.downloadmanager.Download;
import com.novoda.downloadmanager.DownloadManagerBuilder;
import com.novoda.downloadmanager.lib.DownloadClientReadyChecker;
import com.novoda.downloadmanager.lib.DownloadManager;
import com.novoda.downloadmanager.lib.NotificationCustomiser;
import com.novoda.downloadmanager.lib.NotificationCustomiserProvider;

public class DemoApplication extends Application implements DownloadClientReadyChecker, NotificationCustomiserProvider {

    private OneRuleToBindThem oneRuleToBindThem;
    private NotificationCustomiser notificationCustomiser;

    @Override
    public void onCreate() {
        super.onCreate();
        notificationCustomiser = new DemoNotificationCustomiser(DemoApplication.this);
        oneRuleToBindThem = new OneRuleToBindThem();

        DownloadManager downloadManager = DownloadManagerBuilder.from(this).build();
        downloadManager.sanityCheckBatchStatuses();
        downloadManager.forceStart();
    }

    @Override
    public boolean isAllowedToDownload(Download download) {
        // Here you would add any reasons you may not want to download
        // For instance if you have some type of geo-location lock on your download capability
        return oneRuleToBindThem.shouldWeDownload(download);
    }

    @Override
    public NotificationCustomiser getNotificationCustomiser() {
        return notificationCustomiser;
    }

    private static final class OneRuleToBindThem {

        /**
         * @return for our demo we expect always to return true ... unless you want to conquer the galaxy
         */
        public boolean shouldWeDownload(Download download) {
            return download.getTotalSize() > SensorManager.GRAVITY_DEATH_STAR_I;
        }
    }

}

Remove stetho