Skip to content

Advanced Use Guideline

Jacksgong edited this page Apr 4, 2018 · 15 revisions

Debug OkDownload

I. Global Control

OkDownload.with().setMonitor(monitor);

DownloadDispatcher.setMaxParallelRunningCount(3);

RemitStoreOnSQLite.setRemitToDBDelayMillis(3000);

II. Injection Component

If you want to inject your components, please invoke following method before you using OkDownload:

OkDownload.Builder builder = new OkDownload.Builder(context)
        .downloadStore(downloadStore)
        .callbackDispatcher(callbackDispatcher)
        .downloadDispatcher(downloadDispatcher)
        .connectionFactory(connectionFactory)
        .outputStreamFactory(outputStreamFactory)
        .downloadStrategy(downloadStrategy)
        .processFileStrategy(processFileStrategy)
        .monitor(monitor);

OkDownload.setSingletonInstance(builder.build());
Clone this wiki locally