Skip to content

Commit 91d55a3

Browse files
committed
add update.json
1 parent 8ff5ea2 commit 91d55a3

File tree

2 files changed

+10
-31
lines changed

2 files changed

+10
-31
lines changed

README.md

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -23,41 +23,14 @@ dependencies {
2323
}
2424
```
2525

26-
###使用方式:
27-
28-
- 首先。在使用前对其进行配置
26+
###效果展示
2927

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+
- 使用默认更新:
5229

53-
- 在要进行检查更新的地方,使用UpdateBuilder类进行检查
5430

55-
```
56-
// 可在任意线程进行调用
57-
UpdateBuilder.create().check();
58-
```
31+
###使用方式:
5932

60-
OK。最简单的用法就这么点。当然。如果需要查看其他配置请查看[详细配置说明](./Usage.md)
33+
[查看wiki](https://github.com/yjfnypeu/UpdatePlugin/wiki)
6134

6235
###流程图
6336
![](./screenshots/updatePlugin.png)

update.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
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+
}

0 commit comments

Comments
 (0)