-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Initialization
Jacksgong edited this page Jun 11, 2017
·
43 revisions
FileDownloader is installed by adding the following dependency to your build.gradle file:
dependencies {
compile 'com.liulishuo.filedownloader:library:1.5.4'
}
To begin using FileDownloader, have yourApplication#onCreate
invoke the FileDownloader.init(this)
such as:
If your want to customize
OkHttpClient
for downloading files, @see DemoApplication
public XXApplication extends Application{
...
@Override
public void onCreate() {
super.onCreate();
/**
* Just for cache Application's Context, and ':filedownloader' progress will NOT be launched
* by below code, so please do not worry about performance.
*/
FileDownloader.init(getApplicationContext());
}
...
}
-
不用担心
init
方法并不会做多余的事,只会缓存相关变量: DO NOT worry about the work oninit
because we just use this method to holdApplicationContext
andInitCustomMaker
- Initialization
- Start downloading
- Pause or Stop
- Get the internal stored data
- Customizable Component
- Interface