Veecheck is a small library that can be configured to periodically retrieve a
small XML document and issue a Notification
based on the current version of the application and the versions listed in the
document.
It is designed to be used to notify users when new versions of an application are available.
Veecheck is distributed under the Apache Version 2.0 licence with the exception of the source code for the sample application which is public domain. Please consult the terms of this licence before using the software. Previous versions of Veecheck were licensed under the GPL v2 licence
For alternative licencing please email me at tomgibara dot com.
The screenshots below are from the Veecheck Sample application.
By far the simplest way to start using the Veecheck library, is to download the source code for the sample application and modify it to meet your needs.
VeecheckReceiver
class.VeecheckService
class.DefaultNotifier
class create a concrete extension
of the VeecheckActivity
class.AndroidManifest.xml
file for these
components so that the receiver receives intents with actions
<your app package name>.VEECHECK_RESCHEDULE_CHECKS
and
<your app package name>.VEECHECK_CONSIDER_CHECK
and the service
receives intents with the action <your app package name>.VEECHECK_PERFORM_CHECK
(see the sample application).
android.permission.INTERNET
permission.PrefSettings
convenience class, add code to your
application that will initialize the settings for your application
(see the sample application).The document that is parsed by this library is an XML document in which:
http://www.tomgibara.com/android/veecheck/SCHEMA.1
<versions>
.The only elements recognized by the parser are:
version
>intent
>If no matching version elements are found in the document, the user is not notified.
The attributes on the version element are used to specify values for the application version to match. Every supplied attribute must exactly match the current application version otherwise the element will be ignored. A version element with no attributes will match any application version.
packageName
versionCode
versionName
buildBrand
buildId
buildModel
The attributes on an intent element closely model the key properties of the
Android Intent
class. There is no requirement that the attributes
of this element be mapped directly onto the corresponding Intent
properties – this is under the control of the application which uses the
veecheck library (though the default VeecheckNotifier
implementation does this).
action
data
type
extras
Direct users of the application versioned 1.0.0 to a (eg. an upgrade activity)
<versions xmlns="http://www.tomgibara.com/android/veecheck/SCHEMA.1">
<version versionName="1.0.0" >
<intent action="com.example.app.ACTION_UPGRADE" />
</version>
</versions>
Direct the user of any application without version code 4 to a webpage:
<versions xmlns="http://www.tomgibara.com/android/veecheck/SCHEMA.1">
<version versionCode="4"></version>
<version>
<intent
action="android.intent.action.VIEW"
data="http://www.example.com/upgrade" type="text/html"
/>
</version>
</versions>
Use extras to communicate the type and importance of an upgrade:
<versions xmlns="http://www.tomgibara.com/android/veecheck/SCHEMA.1">
<version versionCode="1">
<intent extras="importance: urged; type: security" />
</version>
<version versionCode="2">
<intent extras="importance: recommended; type: fixes" />
</version>
<version versionCode="3">
<intent extras="importance: optional; type: cosmetic" />
</version>
</versions>
Providing upgrade information for more than one application:
<versions xmlns="http://www.tomgibara.com/android/veecheck/SCHEMA.1">
<version packageName="com.example.app1" versionCode="1">
<intent ... />
</version>
<version packageName="com.example.app2" versionCode="1">
<intent ... />
</version>
</versions>
PrefSettings
class has changed the name of the check
interval preference key (KEY_CHECK_INTERVAL
) from
"min_period"
to "check_interval"
. Applications wishing
to preserve this setting (should it differ from the default) will need to
'copy over' the preference value.VeecheckActivity
has been added to allow users to confirm if
they want to proceed with the update. Applications do not need to use such an
activity, but a new DefaultNotifier
class has been added to make it
easy to do so.VeecheckActivity
.
Note that this is not the same as disabling update checks; the
update intent supplied by the versions document is ignored until a different
intent is chosen. Note further that for this option to work updates to different
versions should have different Intents. In practice this should be easy to
achieve.https
scheme if your veecheck
document resides on a secure server. For example, this could be done for the
SampleService
class by adding a call to
filter.addDataScheme("https")
. If you forget to do this then it can
be very difficult to diagnose the problem.