技术控

    今日:2| 主题:49195
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] ForceUpdate

[复制链接]
一瞬间的记忆 发表于 2016-10-7 10:23:37
103 1

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
Force your users to update the app, or notify about non-critical updates.
  Download

  Download the latest JAR:
  or via Gradle:
  1. compile 'net.skoumal.forceupdate:force-update:0.1.0'
复制代码
Usage

  This library was designed with full customizability in mind. Whole library is based on three simple terms:
  
       
  •       VersionProvider- provides version from some source, for example from your APK, Google Play, your server, or any other third party service. You can choose one of existing VersionProviders, or create your own.      
       
  •       UpdateView- abstraction of the way how we notify user about new version available (recommended update) or about necessary update (forced update). Predefined Activities and dialogs available again.      
       
  •       CheckInterval- how often should we ask        VersionProviderfor new data. The under-the-hood strategy is to ask with every        Activity.onResume()event if        MinIntervalis already reached.      
      
  To init ForceUpdate library use this simple builder in your Application:
  1. new ForceUpdate.Builder()
  2.         // required - needs android.app.Application object
  3.         .application(this)
  4.         // defaults to NULL - no force update view will ever appear
  5.         .minAllowedVersionProvider(new MyCustomVersionProvider())
  6.         // defaults to 24 hours
  7.         .minAllowedVersionCheckMinInterval(4 * 3600)
  8.         // defaults to version from http://carreto.pt/tools/android-store-version/?package=<your package>
  9.         .recommendedVersionProvider(new GooglePlayVersionProvider())
  10.         // defaults to 24 hours
  11.         .recommendedVersionCheckMinInterval(6 * 3600)
  12.         // defaults to NULL - no force update view will ever appear
  13.         .excludedVersionProvider(new MyExcludedVersionListProvider())
  14.         // defaults to 24 hours
  15.         .excludedVersionCheckMinInterval(8 * 3600)
  16.         // defaults to current apk version
  17.         .currentVersionProvider(new ApkVersionProvider())
  18.         // defaults to predefined activity
  19.         .forcedUpdateView(new ForcedVersionActivityView())
  20.         // defaults to predefined dialog
  21.         .recommendedUpdateView(new RecommendedVersionView())
  22.         // alias for .build().init()
  23.         .buildAndInit();
复制代码
Extras

  Library is able to detect crash during last version check and hangs main thread during next app start to avoid any other code execution and allow successful version check. If there is new version available it fires notification automatically.
  License

  1. Copyright 2016 SKOUMAL, s.r.o.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5.    http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
复制代码
友荐云推荐




上一篇:Creating A Bootstrap Admin Template With Charts
下一篇:Making Sense of Cloud Native Applications, Platforms, Microservices, and More
酷辣虫提示酷辣虫禁止发表任何与中华人民共和国法律有抵触的内容!所有内容由用户发布,并不代表酷辣虫的观点,酷辣虫无法对用户发布内容真实性提供任何的保证,请自行验证并承担风险与后果。如您有版权、违规等问题,请通过"联系我们"或"违规举报"告知我们处理。

lin346516709 发表于 2016-10-15 15:09:18
虽不明,但觉厉,你懂的
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读

扫码访问 @iTTTTT瑞翔 的微博
回页顶回复上一篇下一篇回列表手机版
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )|网站地图 酷辣虫

© 2001-2016 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表