{"id":19483642,"url":"https://github.com/lizhangqu/vitamin","last_synced_at":"2026-05-09T05:05:11.965Z","repository":{"id":142563607,"uuid":"97579918","full_name":"lizhangqu/vitamin","owner":"lizhangqu","description":"vitamin is an universal config library in android.","archived":false,"fork":false,"pushed_at":"2017-07-20T05:00:25.000Z","size":212,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T17:46:20.912Z","etag":null,"topics":["adnroid","config","ini","json","properties","sharedpreferences","universal","xml","yaml"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lizhangqu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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}},"created_at":"2017-07-18T09:28:32.000Z","updated_at":"2017-07-20T03:23:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"f35961c8-b728-4ce0-940d-178a63d677fd","html_url":"https://github.com/lizhangqu/vitamin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/lizhangqu/vitamin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhangqu%2Fvitamin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhangqu%2Fvitamin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhangqu%2Fvitamin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhangqu%2Fvitamin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lizhangqu","download_url":"https://codeload.github.com/lizhangqu/vitamin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lizhangqu%2Fvitamin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":285187925,"owners_count":27129352,"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-11-19T02:00:05.673Z","response_time":65,"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":["adnroid","config","ini","json","properties","sharedpreferences","universal","xml","yaml"],"created_at":"2024-11-10T20:16:13.101Z","updated_at":"2025-11-19T05:04:37.200Z","avatar_url":"https://github.com/lizhangqu.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Vitamin\n\nvitamin is an universal config library in android.\n\n## Changelog\n\nSee details in [CHANGELOG](https://github.com/lizhangqu/vitamin/blob/master/CHANGELOG.md).\n\n## Examples\n\nI have provided a sample.\n\nSee sample [here on Github](https://github.com/lizhangqu/vitamin/tree/master/app).\n\nTo run the sample application, simply clone this repository and use android studio to compile, install it on a connected device.\n\n## Usage\n\n### Dependency\n\n**latest version**\n\n[ ![Download](https://api.bintray.com/packages/lizhangqu/maven/vitamin/images/download.svg) ](https://bintray.com/lizhangqu/maven/vitamin/_latestVersion)\n\n\n**gradle**\n\n```\ndependencies {\n    //noinspection GradleCompatible\n    compile \"io.github.lizhangqu:vitamin:${latest_version}\"\n}\n```\n\n**maven**\n\n```\n\u003cdependencies\u003e\n    \u003cdependency\u003e\n      \u003cgroupId\u003eio.github.lizhangqu\u003c/groupId\u003e\n      \u003cartifactId\u003evitamin\u003c/artifactId\u003e\n      \u003cversion\u003e${latest_version}\u003c/version\u003e\n    \u003c/dependency\u003e\n\u003c/dependencies\u003e\n```\n\n### Third Party\n\nAdd third party support if you need to use.\n\n```\n    compile(\"org.ini4j:ini4j:0.5.4\")\n    compile(\"org.yaml:snakeyaml:1.18\")\n    compile(\"dom4j:dom4j:1.6.1\")\n//    you should add this for dom4j in android extension\n//    dexOptions {\n//        //fix for dom4j\n//        additionalParameters = ['--core-library']\n//    }\n    compile(\"com.alibaba:fastjson:1.1.59.android\")\n    compile(\"com.google.code.gson:gson:2.8.0\")\n```\n\nFor example, if you need use ini config, you should add **compile(\"org.ini4j:ini4j:0.5.4\")**.\n\n### Config Type\n\n - yaml\n - ini\n - json\n - xml\n - properties\n - SharedPreferences\n \n### Set Global Config Type If Needed\n\n```\nVitamin.getInstance().setConfigType(ConfigType configType)\n```\nIt's not must be required.\n \n### Get ReadableConfig\n\n```\nReadableConfig config = Vitamin.getInstance().getReadableConfig(ConfigType configType, String filePathOrName)\nReadableConfig config = Vitamin.getInstance().getReadableConfig(ConfigType configType, InputStream inputStream)\nReadableConfig config = Vitamin.getInstance().getReadableConfig(String filePathOrName)\nReadableConfig config = Vitamin.getInstance().getReadableConfig(InputStream inputStream)\n```\n\nIf you not pass config param, it will get the global type first and then according to the extension about the file.\n\n### Get config\n\n```\nString getString(String key, String defaultValue);\n\nString getString(String key);\n\nboolean getBoolean(String key, boolean defaultValue);\n\nshort getShort(String key, short defaultValue);\n\nint getInt(String key, int defaultValue);\n\nlong getLong(String key, long defaultValue);\n\nfloat getFloat(String key, float defaultValue);\n\ndouble getDouble(String key, double defaultValue);\n\n//may return null if not support\nList\u003cString\u003e getList(String key, List\u003cString\u003e defaultValue);\n\n//may return null if not support\nList\u003cString\u003e getList(String key);\n\n//may return null if not support\n//may ignore key if needed\nMap\u003cString, ?\u003e getMap(String key, Map\u003cString, ?\u003e defaultValue);\n\n//may return null if not support\n//may ignore key if needed\nMap\u003cString, ?\u003e getMap(String key);\n\n//may return null if not support\n\u003cT\u003e T get(String key, Class\u003cT\u003e clazz);\n```\n\n## License\n\nvitamin is under the BSD license. See the [LICENSE](https://github.com/lizhangqu/vitamin/blob/master/LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flizhangqu%2Fvitamin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flizhangqu%2Fvitamin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flizhangqu%2Fvitamin/lists"}