android文件下载器(轻量级)——EasyFileDownload

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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值