Code Monkey home page Code Monkey logo

downloadinstaller's Introduction

DownloadInstaller

Android 应用内下载,储存,安装 ,未知来源等问题处理

  • 处理好了全局FileProvider,未知来源授权确认,通知栏等问题处理。
  • 已经下载的文件不会重复下载
  • 特别是Android 8 首次安装时候的未知来源问题处理,这里的处理方式很强硬,不授权安装未知来源就会一直跳转到授权页面,企业级别的App应用内更新很实用
  • 当然这是可以配置是否需要强制授权安装未知来源 参考:new DownloadInstaller(mContext, downloadUrl, isForceGrantUnKnowSource
  • 工程目前targetSdkVersion=31,已经适配Android 5-12

使用 (1.1.2 版本后支持AndroidX 了,已经适配Android 12)

首先 Gradle 引入(1.1.1 版本是最后一个support 版本,后面是AndroidX了)

mavenCentral():

implementation 'io.github.anylifezlb:DownloadInstaller:2.2.2'

Jcenter 服务供应商已经停止服务了,建议尽快迁移mavenCentral

2.2.2 已经适配存储分区了和Android 12,请大家验证是否符合自己的项目需求后进行更新

  //一般的弹出对话框提示升级
  //如果是企业内部应用升级,大部分都希望升级;其他情况请给予用户选择的自由,尊重用户。
   new DownloadInstaller(mContext, downloadUrl, isForceGrantUnKnowSource,new DownloadProgressCallBack() {
       @Override
       public void downloadProgress(int progress) {
             Log.e("PROGRESS","Progress"+progress);
       }
  
       @Override
       public void downloadException(Exception e) {
             e.printStackTrace();
       }
  

       @Override
       public void onInstallStart() {
  
       }
   }).start();
   

. More,Contact me : [email protected]

image.png

image.png

downloadinstaller's People

Contributors

faceai avatar anylifezlb 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.