{"id":21467162,"url":"https://github.com/snoopycodex/jsonupdatecheckerandroid","last_synced_at":"2025-08-09T10:13:41.717Z","repository":{"id":175356988,"uuid":"258194285","full_name":"SnoopyCodeX/jsonupdatecheckerandroid","owner":"SnoopyCodeX","description":"A JSON-based Update Checker (Customize-able)","archived":false,"fork":false,"pushed_at":"2023-07-14T04:37:01.000Z","size":236,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-17T06:11:44.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SnoopyCodeX.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOGS.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":["https://paypal.me/snoopycodex21"]}},"created_at":"2020-04-23T12:25:01.000Z","updated_at":"2023-12-27T15:42:03.000Z","dependencies_parsed_at":"2023-07-31T14:30:23.104Z","dependency_job_id":null,"html_url":"https://github.com/SnoopyCodeX/jsonupdatecheckerandroid","commit_stats":null,"previous_names":["snoopycodex/jsonupdatecheckerandroid"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/SnoopyCodeX/jsonupdatecheckerandroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnoopyCodeX%2Fjsonupdatecheckerandroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnoopyCodeX%2Fjsonupdatecheckerandroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnoopyCodeX%2Fjsonupdatecheckerandroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnoopyCodeX%2Fjsonupdatecheckerandroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SnoopyCodeX","download_url":"https://codeload.github.com/SnoopyCodeX/jsonupdatecheckerandroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SnoopyCodeX%2Fjsonupdatecheckerandroid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269562686,"owners_count":24438592,"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","status":"online","status_checked_at":"2025-08-09T02:00:10.424Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-11-23T08:16:56.083Z","updated_at":"2025-08-09T10:13:41.690Z","avatar_url":"https://github.com/SnoopyCodeX.png","language":"Java","funding_links":["https://paypal.me/snoopycodex21"],"categories":[],"sub_categories":[],"readme":"# JSON-based Update Checker\n[![Developed by SnoopyCodeX](https://img.shields.io/badge/Developed%20by-SnoopyCodeX-blue.svg?longCache=true\u0026style=for-the-badge)](https://facebook.com/SnoopyCodeX)\n[![Github Release](https://img.shields.io/github/release/SnoopyCodeX/jsonupdatecheckerandroid.svg?style=for-the-badge)](https://github.com/SnoopyCodeX/jsonupdatecheckerandroid/releases) \n[![Github Star](https://img.shields.io/github/stars/SnoopyCodeX/jsonupdatecheckerandroid.svg?style=for-the-badge)](https://github.com/SnoopyCodeX/jsonupdatecheckerandroid) \n[![Github Fork](https://img.shields.io/github/forks/SnoopyCodeX/jsonupdatecheckerandroid.svg?style=for-the-badge)](https://github.com/SnoopyCodeX/jsonupdatecheckerandroid) \n![License](https://img.shields.io/github/license/SnoopyCodeX/jsonupdatecheckerandroid.svg?style=for-the-badge)\n[![DepShield Badge](https://depshield.sonatype.org/badges/SnoopyCodeX/jsonupdatecheckerandroid/depshield.svg)](https://depshield.github.io)\n[![Build Status](https://travis-ci.org/SnoopyCodeX/jsonupdatecheckerandroid.svg?branch=master)](https://travis-ci.org/SnoopyCodeX/jsonupdatecheckerandroid)\n\n- [x] Customizeable\n- [x] Easy to implement\n- [x] JSON-based checker\n- [x] Can download app\n- [x] Can auto install app\n- [x] Automatically check for updates\n- [x] Lightweight library\n- [x] Uses Google's [Gson Library](https://github.com/google/gson) for easier json parsing\n\n# Setup\n### Clone this repo\n- Clone this repo to your device\n```\ngit clone https://github.com/SnoopyCodeX/jsonupdatecheckerandroid\n```\n- After cloning, copy the folder named ```cdph_updatechecker_lib``` to your project's directory then include it in your app level build.gradle\n```groovy\ncompile project(':cdph_updatechecker_lib')\n```\n### JAR File (Unstable)\n- Add this jar file to your app's libs directory\n- (Unstable) [UpdateChecker - v22.0.0](https://raw.githubusercontent.com/SnoopyCodeX/jsonupdatecheckerandroid/master/Jar/v22.0.0-UpdateChecker.jar)\n---\n# Usage\n### Initialize UpdateChecker\n```java\nUpdateChecker checker = UpdateChecker.getInstance(context);\n```\n---\n### Set custom json model (example)\n```java\nchecker.setJsonModel(MyModel.class);\n\npublic class MyModel\n{\n\t@SerializedName(\"description\")\n\tList\u003cString\u003e description;\n\t\n\t@SerializedName(\"name\")\n\tString name;\n\t\n\t@SerializedName(\"version\")\n\tString version;\n\t\n\t@SerializedName(\"downloadUrl\")\n\tString downloadUrl;\n}\n```\n---\n### JSON File to read to (example)\n```json\n{\n  \"name\": \"Test App\",\n  \"version\": \"1.2.0\",\n  \"description\": [\"My description\", \"Test description\"],\n  \"downloadUrl\": \"https://testurl.com/download\"\n}\n```\n---\n### Enable auto update\n```java\nchecker.shouldAutoRun(true);\n```\n---\n### Enable update on both mobile networks\n```java\nchecker.shouldCheckUpdateOnWifiOnly(false);\n```\n---\n### Enable auto installation\n```java\nchecker.shouldAutoInstall(true);\n```\n---\n### Set the url of the json file\n```java\nchecker.setUpdateLogsUrl(\"https://urlhere\");\n```\n---\n### Downloading the app\n```java\n//Returns the filepath of the downloaded app\nUpdateChecker.downloadUpdate(\"https://urlHere\", \"filename.apk\");\n```\n---\n### Installing the app manually\n```java\nUpdateChecker.installApp(file);\n```\n----\n### Add listener\n```java\nchecker.setOnUpdateDetectedListener(new UpdateChecker.OnUpdateDetectedListener() {\n    @Override\n    public void onUpdateDetected(Object info)\n    {}\n});\n```\n\n### Demo Usage\n```java\nUpdateChecker.getInstance(this)\n\t.setUpdateLogsUrl(\"https://pastebin.com/raw/x9JufEML\")\n\t.shouldAutoRun(true)\n\t.shouldAutoInstall(false)\n\t.setJsonModel(Model.class)\n\t.setOnUpdateDetectedListener(new UpdateChecker.OnUpdateDetectedListener() {\n\t\t@Override\n\t\tpublic void onUpdateDetected(Object info)\n\t\t{\n\t\t\ttry {\n\t\t\t\tModel model = (Model) info;\n\t\t\t\tString str_curVer = getPackageManager().getPackageInfo(getPackageName(), 0).versionName;\n\t\t\t\tString str_newVer = model.version;\n\n\t\t\t\t// Check if the current version is lower than the new update version\n\t\t\t\tif(UpdateChecker.compareVersion(str_curVer, str_newVer))\n\t\t\t\t{\n\t\t\t\t\tString txt = String.format(\"Name: %s\\nVersion: %s\\nDownload: %s\\nDescription: %s\",\n\t\t\t\t\t\t\t\t\t\t\t   model.name,\n\t\t\t\t\t\t\t\t\t\t\t   model.version,\n\t\t\t\t\t\t\t\t\t\t\t   model.downloadUrl,\n\t\t\t\t\t\t\t\t\t\t\t   model.description.get(0)\n\t\t\t\t\t\t\t\t\t\t\t   );\n\t\n\t\t\t\t\tAlertDialog dlg = new AlertDialog.Builder(MainActivity.this).create();\n\t\t\t\t\tdlg.setCancelable(true);\n\t\t\t\t\tdlg.setCanceledOnTouchOutside(false);\n\t\t\t\t\tdlg.setMessage(txt);\n\t\t\t\t\tdlg.setTitle(\"Update Available\");\n\t\t\t\t\tdlg.show();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tToast.makeText(MainActivity.this, \"You have the latest version!\", Toast.LENGTH_LONG).show(); \n\t\t\t} catch(Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnoopycodex%2Fjsonupdatecheckerandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnoopycodex%2Fjsonupdatecheckerandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnoopycodex%2Fjsonupdatecheckerandroid/lists"}