



Framework for dispatching various procedure on update application.
Photo License CC by NC-ND
This library is under development so API may be changed drastically until the first major release.
PrepareVersionModule
to declare what to do when your application is upgraded or newly installed.
publicclassMyModuleimplementsVersionModule {@VersionCode({1,2,3})// foo() is called when the app is updated to version code = 1, 2 and 3publicvoidfoo() { }@VersionCode(4)// bar() is called when the app is updated to version code = 4publicvoidbar() { }}
If you like to have them executed only when it is an upgrade, useUpgradeOnly
annotation.
publicclassMyModuleimplementsVersionModule {@VersionCode({1,2,3})// foo() is called when the app is updated to version code = 1, 2 and 3publicvoidfoo() { }@VersionCode(4)@UpgradeOnly// bar() is called when the app is updated to version code = 4, and not called when the app is newly installedpublicvoidbar() { }}
Register yourVersionModule
whenApplication#onCreate()
called.
publicclassMyAppextendsApplication {@OverridepublicvoidonCreate() {super.onCreate();Fit.initialize(this,newMyModule()); }}
And execute update procedure like this.
Fit.getInstance().execute();
CurrentlyFit
has a synchronous call interface only.Asynchronous call will be introduced in the near future.
Set configuration for ProGuard to keep annotation and annotated methods.
-keepattributes *Annotation*-keepclassmembersclass * {@jp.yokomark.fit.VersionCode *;}
Apache License v2
Copyright (C) 2014 KeithYokoma, Inc. All rights reserved.Licensed under the Apache License, Version 2.0 (the "License"); you may not usethis file except in compliance with the License. You may obtain a copy of theLicense at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software distributedunder the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES ORCONDITIONS OF ANY KIND, either express or implied. See the License for thespecific language governing permissions and limitations under the License.