FileDownloader mDownloader = FileDownloader.getInstance(getApplication()); mDownloader.setExtend(".apk"); mDownloader.setFilePath(Environment.getExternalStorageDirectory() + "/apk/"); mDownloader.addFile("http://zhuzher.vanke.com/uip/zhuzher.apk"); mDownloader.setDownloadObserver(new DownloadObserver() { @Override public void onUpdate(String apkUrl, String file, int completeSize, int apkFileSize) { //do your thing } @Override public void onComplete(String file) { //do your thing } @Override public void onError(String apkUrl, int type, int state) { //do your thing } });
GitHub账号:<a href="https://github.com/liuguangli/">https://github.com/liuguangli</a>,欢迎fork,贡献你的idea,一起做好每一件小事。
个人博客:www.liuguangli.win