{"id":16744854,"url":"https://github.com/marteinn/android-config","last_synced_at":"2025-07-25T09:10:16.599Z","repository":{"id":16162838,"uuid":"18908962","full_name":"marteinn/Android-Config","owner":"marteinn","description":"Config helps to manage the different build settings of your app.","archived":false,"fork":false,"pushed_at":"2014-06-23T20:15:43.000Z","size":252,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-22T14:25:14.395Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/marteinn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-18T09:31:01.000Z","updated_at":"2016-12-05T12:32:56.000Z","dependencies_parsed_at":"2022-09-12T10:11:46.675Z","dependency_job_id":null,"html_url":"https://github.com/marteinn/Android-Config","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marteinn%2FAndroid-Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marteinn%2FAndroid-Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marteinn%2FAndroid-Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marteinn%2FAndroid-Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marteinn","download_url":"https://codeload.github.com/marteinn/Android-Config/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243814907,"owners_count":20352037,"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-10-13T01:44:16.645Z","updated_at":"2025-03-16T01:40:50.971Z","avatar_url":"https://github.com/marteinn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"Android-Config\n================\n\nAndroid-Config helps to manage the different build settings of your app.\n\n## How it works\n\nConfig loads and parses .properties files placed in the **res/raw** folder of your application (it loads a debug file if debuggable is true), then exposes a class with a set of getParam methods. It's built around the same principle as [Android-Features](https://github.com/marteinn/Android-Features).\n\n## Implementation\n\nFirst create a folder in your res folder named raw, then place two files there, one for the live build and one for the debug/dev (I usually name them config_app_debug.properties and config_app.properties)\n\nThen open the files and specify your settings using the following format (we parse them with java.util.Properties).\n\n    URL = http://marteinn.se\n    AGE = 3600\n    TRACKING = 1\n    \n(Integer values 1 and 0 can also be treated as booleans).\n\n\nAfter that you need to include the utility and run createInstance when your app starts, I recommend you place it in application onCreate, like this:\n\n\n    public class YourApplication extends Application {\n        @Override\n        public void onCreate() {\n            Config.createInstance().load(this,\n                R.raw.config_app_debug,\n                R.raw.config_app);\n        }\n    }\n\nYou can also skip the validation part and load the configuration file directly.\n\n    public class YourApplication extends Application {\n        @Override\n        public void onCreate() {\n            Config.createInstance().load(this, R.raw.config_app_debug);\n        }\n    }\n\n\n\n\nThen retrive the various settings with these methods:\n\n\tConfig.getInstance().getParam(\"URL\"); // http://marteinn.se\n\tConfig.getInstance().getIntParam(\"AGE\"); // 3600\n\tConfig.getInstance().getBooleanParam(\"TRACKING\"); // true\n\t\n## Setup\n\n#### Locally\n\nDownload [config.aar](https://github.com/marteinn/Android-Config/blob/master/dist/config.aar) and move it to your libs folder, then make sure you got libs specified as a flatDir in `gradle.config`\n\t\n\trepositories {\n\t    mavenCentral()\n\t    flatDir {\n\t        dirs 'libs'\n\t    }\n\t}\n\nAfter that just include it as any other dependency.\n \n\tdependencies {\n\t\tcompile 'se.marteinn.utils.config:config:1.0@aar'\n\t}\n\t\n\t\n## Contributing\n\nWant to contribute? Awesome. Just send a pull request.\n\n\n## License\n\nAndroid-Features is released under the [MIT License](http://www.opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarteinn%2Fandroid-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarteinn%2Fandroid-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarteinn%2Fandroid-config/lists"}