BackgroundUpdate

Introduction: 后台更新 APP(两句代码实现)
More: Author   ReportBugs   
Tags:

后台更新 APP(两句代码实现)

先看预览图 :

(1)调用 Dialog 更新对话框效果



(2)调用 Notification 更新效果

前言

1,使用了 retorfit2 + rxjava 做的下载库

2,apk 下载完毕会自动跳到安装界面,下载过程可取消

3,需要修改更多内容可以下载 library 自行修改

4,不妥之处或 BUG 请 Issues 指出,谢谢

Usage

With Gradle:

  compile 'com.wenwenwen888:bgupdate:1.0.7'

How to use

第一句 , 调用下载:

  • (a.调用 Dialog 对话框下载
    BgUpdate.updateForDialog(context, url, filePath);
    
  • (b.调用 Notification 下载
    BgUpdate.updateForNotification(context , url, filePath);
    
  • (c.url 即为下载 apk 的链接,下面为 filepath 示例
    String filePath = Environment.getExternalStorageDirectory() + "/xxx.apk";
    
    第二句 , 在 onDestroy()的时候关闭服务:
    BgUpdate.closeService(context);
    

End (。・`ω´・)

Apps
About Me
GitHub: Trinea
Facebook: Dev Tools