GithubHelp home page GithubHelp logo

updateapp's Introduction

UpdateApp

这是一个可以自动更新phonegap android app 的plugin,能显示下载进度条,下载完自动安装。

使用方法:

  • 项目中引入UpdateApp.java,updateAppPlugin.js
  • Phongegap配置文件(res->xml->config.xml)添加
  • 在你的服务器上放置version.js,插件会自动与该文件进行比对,以便自动更新
  • 在phonegap的OnDeviceReady事件中即可使用插件了

API:

  • window.plugin.updateApp.checkAndUpdate(checkPath) 检查并更新程序 checkPath为你的version.js的访问地址
  • window.plugin.updateApp.getCurrentVerInfo 返回APP当前的versionCode和versionName
  • window.plugin.updateApp.getServerVerInfo 返回服务器上APP的versionCode和versionName

version.js

[{'verCode':2,'verName':'1.2.1','apkPath':'http://****.com/your.apk'}] verCode,verName对应APK中AndroidManifest.xml中的android:versionCode="1" android:versionName="1.0"

  • verCode 版本代码 int型 程序更新的依据
  • verName 版本名称 一般用来填写程序的版本号如1.0 1.1 2.0等
  • apkPath 版本对应的APK下载地址,可以放在自己的服务器上,也可以是市场的下载地址

updateapp's People

Contributors

shixy avatar

Watchers

James Cloos avatar Raymond Zhu 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.