Coder Social home page Coder Social logo

appupdater's Introduction

AppUpdater

Image

Download CI API License Blog

AppUpdater for Android 是一个专注于App更新一键傻瓜式集成的开源库,主要包括app-updater和app-dialog。

下载更新和弹框提示分开,是因为这本来就是两个逻辑。完全独立开来能有效的解耦。

  • app-updater 主要负责后台下载更新App,无需担心下载时各种配置相关的细节,一键傻瓜式升级。
  • app-dialog 主要是提供常用的Dialog和DialogFragment,简化弹框提示,样式支持高度自定义。

app-updater + app-dialog 配合使用,谁用谁知道。

功能介绍

  • 专注于App更新一键傻瓜式升级
  • 支持下载监听
  • 支持下载失败,重新下载
  • 支持通知栏提示内容和过程全部可配置
  • 支持Android O

Gif 展示

Image

引入

Maven:

    //app-updater
    <dependency>
      <groupId>com.king.app</groupId>
      <artifactId>app-updater</artifactId>
      <version>1.0</version>
      <type>pom</type>
    </dependency>
    
    //app-dialog
    <dependency>
      <groupId>com.king.app</groupId>
      <artifactId>app-dialog</artifactId>
      <version>1.0</version>
      <type>pom</type>
    </dependency>

Gradle:

    //app-updater
    compile 'com.king.app:app-updater:1.0'
    
    //app-dialog
    compile 'com.king.app:app-dialog:1.0'

Lvy:

    //app-updater
    <dependency org='com.king.app' name='app-dialog' rev='1.0'>
      <artifact name='$AID' ext='pom'></artifact>
    </dependency>
    
    //app-dialog
    <dependency org='com.king.app' name='app-dialog' rev='1.0'>
      <artifact name='$AID' ext='pom'></artifact>
    </dependency>
如果Gradle出现compile失败的情况,可以在Project的build.gradle里面添加如下:(也可以使用上面的GitPack来complie)
    allprojects {
        repositories {
            //...
            maven { url 'https://dl.bintray.com/jenly/maven' }
        }
    }

示例

    //一句代码,傻瓜式更新
    new AppUpdater(getContext(),url).start();
    //简单弹框升级
    AppDialogConfig config = new AppDialogConfig();
    config.setTitle("简单弹框升级")
            .setOk("升级")
            .setContent("1、新增某某功能、\n2、修改某某问题、\n3、优化某某BUG、")
            .setOnClickOk(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    new AppUpdater.Builder()
                            .serUrl(mUrl)
                            .setFilename("AppUpdater.apk")
                            .build(getContext())
                            .start();
                    AppDialog.INSTANCE.dismissDialog();
                }
            });
    AppDialog.INSTANCE.showDialog(getContext(),config);
    //简单DialogFragment升级
    AppDialogConfig config = new AppDialogConfig();
    config.setTitle("简单DialogFragment升级")
            .setOk("升级")
            .setContent("1、新增某某功能、\n2、修改某某问题、\n3、优化某某BUG、")
            .setOnClickOk(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    new AppUpdater.Builder()
                            .serUrl(mUrl)
                            .setFilename("AppUpdater.apk")
                            .build(getContext())
                            .start();
                    AppDialog.INSTANCE.dismissDialogFragment(getSupportFragmentManager());
                }
            });
    AppDialog.INSTANCE.showDialogFragment(getSupportFragmentManager(),config);

更多使用示例请查看App

关于我

Name: Jenly

Email: jenly1314#gmail.com / jenly1314#vip.qq.com

CSDN: jenly121

Github: jenly1314

微信公众号:

公众号

加入QQ群: 20867961

appupdater's People

Watchers

James Cloos avatar Jackey avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.