{"id":3641,"url":"https://github.com/KeithYokoma/Fit","last_synced_at":"2025-08-03T22:32:05.966Z","repository":{"id":18114186,"uuid":"21187043","full_name":"KeithYokoma/Fit","owner":"KeithYokoma","description":"Framework for dispatching various procedure on update application.","archived":false,"fork":false,"pushed_at":"2018-08-14T01:15:28.000Z","size":140,"stargazers_count":59,"open_issues_count":0,"forks_count":2,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-11-25T02:14:42.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ihcsim/cockroachdb-formula","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KeithYokoma.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-25T02:02:06.000Z","updated_at":"2022-06-21T04:11:50.000Z","dependencies_parsed_at":"2022-07-25T06:30:05.427Z","dependency_job_id":null,"html_url":"https://github.com/KeithYokoma/Fit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeithYokoma%2FFit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeithYokoma%2FFit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeithYokoma%2FFit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KeithYokoma%2FFit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KeithYokoma","download_url":"https://codeload.github.com/KeithYokoma/Fit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228571844,"owners_count":17938772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:47.235Z","updated_at":"2024-12-07T06:30:41.390Z","avatar_url":"https://github.com/KeithYokoma.png","language":"Java","funding_links":[],"categories":["Hotfix","Libraries"],"sub_categories":["Version Checking"],"readme":"# Fit\n\n[![Gitter](http://img.shields.io/badge/Gitter-Join%20Chat-brightgreen.svg?style=flat)](https://gitter.im/KeithYokoma/Fit?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Android Arsenal](https://img.shields.io/badge/Android%20Arsenal-Fit-brightgreen.svg?style=flat)](https://android-arsenal.com/details/1/1174)\n[![License](http://img.shields.io/badge/License-Apache%202-brightgreen.svg?style=flat)](https://github.com/KeithYokoma/Fit/blob/master/LICENSE.md)\n[![CircleCI](https://circleci.com/gh/KeithYokoma/Fit.svg?style=shield)](https://circleci.com/gh/KeithYokoma/Fit.svg?style=shield)\n\nFramework for dispatching various procedure on update application.\n\n![Fit](https://farm3.staticflickr.com/2780/4285120077_2eae97a495_o_d.jpg)\n[Photo License CC by NC-ND](https://creativecommons.org/licenses/by-nc-nd/2.0/)\n\n# Attention\n\nThis library is under development so API may be changed drastically until the first major release.\n\n# Usage\n\nPrepare `VersionModule` to declare what to do when your application is upgraded or newly installed.\n\n```java\npublic class MyModule implements VersionModule {\n    @VersionCode({1, 2, 3}) // foo() is called when the app is updated to version code = 1, 2 and 3\n    public void foo() {\n\n    }\n\n    @VersionCode(4) // bar() is called when the app is updated to version code = 4\n    public void bar() {\n\n    }\n}\n```\n\nIf you like to have them executed only when it is an upgrade, use `UpgradeOnly` annotation.\n\n```java\npublic class MyModule implements VersionModule {\n    @VersionCode({1, 2, 3}) // foo() is called when the app is updated to version code = 1, 2 and 3\n    public void foo() {\n\n    }\n\n    @VersionCode(4)\n    @UpgradeOnly // bar() is called when the app is updated to version code = 4, and not called when the app is newly installed\n    public void bar() {\n\n    }\n}\n```\n\nRegister your `VersionModule` when `Application#onCreate()` called.\n\n```java\npublic class MyApp extends Application {\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        Fit.initialize(this, new MyModule());\n    }\n}\n```\n\nAnd execute update procedure like this.\n\n```java\nFit.getInstance().execute();\n```\n\nCurrently `Fit` has a synchronous call interface only.\nAsynchronous call will be introduced in the near future.\n\n# ProGuard Settings\n\nSet configuration for ProGuard to keep annotation and annotated methods.\n\n```java\n-keepattributes *Annotation*\n-keepclassmembers class * {\n    @jp.yokomark.fit.VersionCode *;\n}\n```\n\n# License\n\nApache License v2\n\n```\nCopyright (C) 2014 KeithYokoma, Inc. All rights reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed\nunder the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\nCONDITIONS OF ANY KIND, either express or implied. See the License for the\nspecific language governing permissions and limitations under the License.\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeithYokoma%2FFit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FKeithYokoma%2FFit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FKeithYokoma%2FFit/lists"}