Skip to content

Commit

Permalink
更新版本1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangwei committed Oct 23, 2015
1 parent 9765a0d commit 8800e4a
Show file tree
Hide file tree
Showing 8 changed files with 341 additions and 371 deletions.
16 changes: 0 additions & 16 deletions AndroidManifest.xml

This file was deleted.

38 changes: 38 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Android auto update plugin for Phonegap/Cordova 1.0.0 #


## Adding the Plugin to your project ##

The plugin conforms to the Cordova plugin specification, it can be installed
using the Cordova / Phonegap command line interface.

```
phonegap plugin add https://github.com/lovelyelfpop/androidUpdatePlugin

cordova plugin add https://github.com/lovelyelfpop/androidUpdatePlugin
```

## version.txt ##

Modify the "version.txt", and put it on your server.

The encoding of this file must be UTF-8.

`verCode`: - version Code, must be an integer

`verName`: - version Name

`apkPath`: - the url of the apk file

`releaseNote`: - release Note


## Using the plugin ##

To use, call the method as follows:

```javascript
plugins.update.updateApp(upgradeUrl, success, failure);
```

`upgradeUrl`: - the url of the file "version.txt" , 'http://www.aio7.com:8189/version.txt' for example.
50 changes: 33 additions & 17 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,26 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>

<plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
id="com.zybx.xiaofu"
version="0.1.0">
id="com.plugin.update"
version="1.0.0">
<name>apkUpdate</name>
<description>Sample PhoneGap Apk Update Plugin</description>
<description>PhoneGap/Cordova Apk Update Plugin</description>
<license>MIT</license>
<keywords>phonegap,android,autoupdate</keywords>


<js-module src="www/updateAppPlugin.js" name="UpdateApp">
<clobbers target="window.update" />
</js-module>

<keywords>phonegap,cordova,android,autoupdate</keywords>

<!-- android -->
<platform name="android">
<config-file target="res/xml/config.xml" parent="/*">
<feature name="UpdateApp">
<param name="android-package" value="com.zybx.xiaofu.UpdateApp" />
</feature>
</config-file>
<source-file src="src/UpdateApp.java" target-dir="src/com/zybx/xiaofu" />
</platform>
<js-module src="www/updateAppPlugin.js" name="UpdateApp">
<clobbers target="plugins.update" />
</js-module>

<config-file target="res/xml/config.xml" parent="/*">
<feature name="UpdateApp">
<param name="android-package" value="com.plugin.update.UpdateApp" />
</feature>
</config-file>

<config-file target="AndroidManifest.xml" parent="/*">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</config-file>

<config-file target="res/values/strings.xml" parent="/*">
<string name="soft_update_title">新版本</string>
<string name="soft_update_updatebtn">现在更新</string>
<string name="soft_update_later">以后再说</string>
<string name="soft_updating">更新中...</string>
<string name="soft_update_cancel">取消</string>
</config-file>

<source-file src="src/UpdateApp.java" target-dir="src/com/plugin/update" />

<source-file src="res/layout/softupdate_progress.xml" target-dir="res/layout"/>
</platform>
</plugin>

10 changes: 0 additions & 10 deletions res/values/strings.xml

This file was deleted.

Loading

0 comments on commit 8800e4a

Please sign in to comment.