https://github.com/coding-dream/autoupdate
git modules 项目共用核心模块(core)
https://github.com/coding-dream/autoupdate
autoupdate checkupdate
Last synced: 7 months ago
JSON representation
git modules 项目共用核心模块(core)
- Host: GitHub
- URL: https://github.com/coding-dream/autoupdate
- Owner: coding-dream
- Created: 2016-12-02T05:30:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-22T12:42:16.000Z (almost 8 years ago)
- Last Synced: 2025-01-11T21:32:44.711Z (9 months ago)
- Topics: autoupdate, checkupdate
- Language: Java
- Homepage:
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Android自动更新库
服务器url返回的的内容类似如下
```
{
"versionName":"v1.0",
"versionCode":"2",
"downUrl":"https://git.oschina.net/need88.com/TempFile/raw/master/test.apk", //apk的下载地址
"updateInfo":"1.更新xxx\n2.update bugs\n3.update fixs"
}```
## 方式一
```
UpdateAgent.init(Constants.SERVER_URL);
UpdateAgent.update(this); //默认
//UpdateAgent.forceUpdate(this);//强制
//UpdateAgent.silentUpdate(this);//静默```
## 方式二
```
String jsonStr = getStrFromServer();
UpdateAgent.updateByStr(this,jsonStr, UpdateAgent.Type.defaultType); // UpdateAgent.Type.silentType, UpdateAgent.Type.forceType```