EasyFileDownloader
一个用于android中的轻量级文件下载器,特别适合应用内升级下载APK。
A lightweight for use in the android file downloader Download the APK is especially suitable for application in upgrade
https://github.com/lijunhuayc/EasyFileDownloader
Usage
version 1.1.1
1、add the followings to your build.gradle file
compile 'com.lijunhuayc.downloader:easyfiledownloader:1.1.1'
2、Using the library is really simple, just look at the source code of the provided sample.
public class MainActivity extends Activity implements View.OnClickListener {
private EditText downloadpathText;
private TextView resultView;
private TextView startBt;
private TextView stopBt;
private ProgressBar progressBar;
private Context context;
WolfDownloader wolfDownloader;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
context = this;
downloadpathText = (EditText) this.findViewById(R.id.path);
// downloadpathText.setText("http://221.236.21.155/imtt.dd.qq.com/16891/5C119BDFA17906E5D6F45BDF932460BB.apk?mkey=57d63b47fb8efb5e&f=3580&c=0&fsname=com.shangyi.postop.paitent.android_4.2.0.0_18.apk&hsr=4d5s&p=.apk");
// downloadpathText.setText("https://dl.google.com/dl/android/studio/install/2.2.0.12/android-studio-ide-145.3276617-windows.exe");
downloadpathText.setText("http://xmp.down.sandai.net/kankan/XMPSetup_5.2.3.4962.exe");
progressBar = (ProgressBar) this.findViewById(R.id.downloadbar);
resultView = (TextView) this.findViewById(R.id.resultView);
startBt = (TextView) findViewById(R.id.startBt);
stopBt = (TextView) findViewById(R.id.stopBt);
startBt.setOnClickListener(this);
stopBt.setOnClickListener(this);
String path = downloadpathText.getText().toString();
File saveD