An open API service indexing awesome lists of open source software.

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)

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

```