File tree Expand file tree Collapse file tree 2 files changed +10
-31
lines changed Expand file tree Collapse file tree 2 files changed +10
-31
lines changed Original file line number Diff line number Diff line change @@ -23,41 +23,14 @@ dependencies {
23
23
}
24
24
```
25
25
26
- ###使用方式:
27
-
28
- - 首先。在使用前对其进行配置
26
+ ###效果展示
29
27
30
- ```
31
- // 建议在Application中进行配置。
32
- // UpdateConfig为全局配置。当在其他页面中。使用UpdateBuilder进行检查更新时。
33
- // 对于没传的参数,会默认使用UpdateConfig中的全局配置
34
- UpdateConfig.getConfig()
35
- // 必填:需尽早进行Application初始化操作。建议直接在Application进行初始化的时候进行框架初始化操作
36
- .init(Application.this)
37
- // url 与 checkEntity方法可任选一种填写,且至少必填一种。
38
- // 数据更新接口数据,此时默认为使用GET请求
39
- .url(url)
40
- // 同url方法。CheckEntity方法可填写url,params,method。可在此设置为post请求
41
- .checkEntity(checkEntity)
42
- // 必填:用于从数据更新接口获取的数据response中。解析出Update实例。以便框架内部处理
43
- .jsonParser(new UpdateParser() {
44
- @Override
45
- public Update parse(String response) {
46
- // 此处根据上面url接口返回的数据response进行update类组装。框架内部会使用此
47
- // 组装的update实例判断是否需要更新以做进一步工作
48
- return update;
49
- }
50
- })
51
- ```
28
+ - 使用默认更新:
52
29
53
- - 在要进行检查更新的地方,使用UpdateBuilder类进行检查
54
30
55
- ```
56
- // 可在任意线程进行调用
57
- UpdateBuilder.create().check();
58
- ```
31
+ ###使用方式:
59
32
60
- OK。最简单的用法就这么点。当然。如果需要查看其他配置请查看 [ 详细配置说明 ] ( ./Usage.md )
33
+ [ 查看wiki ] ( https://github.com/yjfnypeu/UpdatePlugin/wiki )
61
34
62
35
###流程图
63
36
![ ] ( ./screenshots/updatePlugin.png )
Original file line number Diff line number Diff line change
1
+ {
2
+ "update_url" : " http://m.shouji.360tpcdn.com/151023/2acc9ecca7ca75e925b9131f964f169f/com.baidu.tieba_mini_101253632.apk" ,
3
+ "update_content" : " 你有新的版本需要更新" ,
4
+ "update_ver_code" : 10 ,
5
+ "update_ver_name" : " 10.00"
6
+ }
You can’t perform that action at this time.
0 commit comments