|
@@ -68,6 +68,7 @@ public class BaseApplication extends Application {
|
|
|
super.onCreate();
|
|
|
instance = this;
|
|
|
initUtils();
|
|
|
+ initDownLoadLib();
|
|
|
//在子线程中初始化
|
|
|
InitializeService.start(this);
|
|
|
}
|
|
@@ -120,6 +121,22 @@ public class BaseApplication extends Application {
|
|
|
Utils.init(this);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 初始化下载库
|
|
|
+ */
|
|
|
+ private void initDownLoadLib() {
|
|
|
+ FileDownloader.setupOnApplicationOnCreate(BaseApplication.getInstance())
|
|
|
+ .connectionCreator(new FileDownloadUrlConnection
|
|
|
+ .Creator(new FileDownloadUrlConnection.Configuration()
|
|
|
+ .connectTimeout(15_000)
|
|
|
+ .readTimeout(15_000)
|
|
|
+ .proxy(Proxy.NO_PROXY)
|
|
|
+ ))
|
|
|
+ .commit();
|
|
|
+ //最简单的初始化
|
|
|
+ //FileDownloader.setup(instance);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
}
|