# LightAppUpdateLib **Repository Path**: jason/LightAppUpdateLib ## Basic Information - **Project Name**: LightAppUpdateLib - **Description**: 轻量的APP更新 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 2 - **Forks**: 0 - **Created**: 2017-09-01 - **Last Updated**: 2024-12-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # LightAppUpdate #### 轻量的APP更新 APP更新是一个经常使用的功能。如何简便方便的应用到我们的APP是我们经常思考的问题,也是这个项目构建的初衷。大神们请略过,不喜勿喷!!! 虽然网络上已经有很多的自动更新的包,有些包实现的已经很丰富、很强大,为什么我还要写一个呢,有的时候我们的工程中已经添加了其他的请求库(例如:volley、OKhttp等), 我们集成的自动更新有可能是其他的网络请求,造成我的项目中可能会有多个相同功能的库,为了解决这个问题,我写了本工程,本工程没有实现依赖任何的第三方库, 网络请求和下载使用的是Android核心自带的 HttpURLConnect类,这样就不用考虑一个工程中有多个功能类似的库,对工程也算是解耦了。 欢迎大家给出意见和建议。不喜勿喷 ## Android 版本更新 [ ![Download](https://api.bintray.com/packages/zdl411437734/maven/lightappupdatelib/images/download.svg) ](https://bintray.com/zdl411437734/maven/lightappupdatelib/_latestVersion) [![API](https://img.shields.io/badge/API-14%2B-orange.svg?style=flat)](https://android-arsenal.com/api?level=14) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## 目录 * [功能介绍](#功能介绍) * [效果图与示例 apk](#效果图与示例-apk) * [Gradle 依赖](#Gradle依赖) * [简单使用](#简单使用) * [详细说明](#详细说明) * [更新日志](#更新日志) * [TODO](#TODO) * [参考感谢](#参考感谢) * [License](#license) ## 功能介绍 - [x] 实现android版本更新 - [x] 自定义接口协议,可以不改变现有项目的协议就能使用 - [x] 支持get,post请求 - [x] 支持强制更新 - [ ] 支持进度显示,对话框进度条,和通知栏进度条展示 - [ ] 支持后台下载 - [ ] 支持简单主题色配置(可以自动从顶部图片提取主色) - [ ] 支持自定义对话框(可以监听下载进度) - [ ] 支持静默下载(可以设置wifi状态下) ## 效果图与示例 apk ![选择更新](http://git.oschina.net/jason/LightAppUpdateLib/raw/master/screen/select_update.png) ![选择更新](http://git.oschina.net/jason/LightAppUpdateLib/raw/master/screen/force_update.png) ![选择更新](http://git.oschina.net/jason/LightAppUpdateLib/raw/master/screen/parse_other_data.png) ## Gradle 依赖 **java方式引用** ```gradle dependencies { compile 'com.zdltech.lightappupdatelib:lightappupdatelib:1.1.2' } ``` ## 简单使用 ```java Get使用 LightUpdateManager.mUpdateUrl = "http://192.168.0.251:8080/update/app/getVersion"; Map params = new HashMap<>(); LightUpdateManager.checkNewApp(this, new UpdateCallback() { @Override public void start() { LogUtils.e("UpdateCallback start is run"); } @Override public void end() { LogUtils.e("UpdateCallback end is run"); } @Override public void update(AppVertionEntity appVertionEntity) { LogUtils.e("UpdateCallback update is run"); LightUpdateManager.showDialog(MainDemoActivity.this,appVertionEntity); } },false,params); POST请求使用 LightUpdateManager.mUpdateUrl = "http://192.168.0.251:8080/update/app/getVersion"; Map params = new HashMap<>(); LightUpdateManager.checkNewApp(this, new UpdateCallback() { @Override public void start() { LogUtils.e("UpdateCallback start is run"); } @Override public void end() { LogUtils.e("UpdateCallback end is run"); } @Override public void update(AppVertionEntity appVertionEntity) { LogUtils.e("UpdateCallback update is run"); LightUpdateManager.showDialog(MainDemoActivity.this,appVertionEntity); } },true,params); ``` ## 详细说明 - [详细说明](java.md) #### 进度条使用的是代码家的「[NumberProgressBar](https://github.com/daimajia/NumberProgressBar)」 ## 更新日志 - V1.1.1 - 简洁的第三方数据转换 - 忽略版本提供处理方法 - V1.0.0 - 实现android版本更新 - 自定义接口协议,可以不改变现有项目的协议就能使用 - 支持get,post请求 - 不依赖其他第三方包,使用HttURLConnection实现网络的请求访问 ## TODO - WIFI等环境配置 - 支持进度显示,对话框进度条,和通知栏进度条展示 - 支持后台下载 - 支持简单主题色配置(可以自动从顶部图片提取主色) - 支持自定义对话框(可以监听下载进度) - 支持静默下载(可以设置wifi状态下) ## 参考感谢 > [WVector/AppUpdate](https://github.com/WVector/AppUpdate) > [AlexLiuSheng/CheckVersionLib](https://github.com/AlexLiuSheng/CheckVersionLib) ## License Copyright 2017 张东领 Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.