{"id":13709174,"url":"https://github.com/AlexJuca/Kiyo","last_synced_at":"2025-05-06T15:32:21.920Z","repository":{"id":51108898,"uuid":"177267144","full_name":"AlexJuca/Kiyo","owner":"AlexJuca","description":"A simple android permissions library for devices running android marshmallow +","archived":false,"fork":false,"pushed_at":"2023-05-15T21:20:43.000Z","size":150,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-13T19:39:42.508Z","etag":null,"topics":["ango-dev-fest-2020","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexJuca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-23T09:03:02.000Z","updated_at":"2023-05-15T21:20:47.000Z","dependencies_parsed_at":"2024-11-13T19:33:27.445Z","dependency_job_id":"fc6a6fbd-d07b-4182-9cfa-36ccecc01975","html_url":"https://github.com/AlexJuca/Kiyo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexJuca%2FKiyo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexJuca%2FKiyo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexJuca%2FKiyo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexJuca%2FKiyo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexJuca","download_url":"https://codeload.github.com/AlexJuca/Kiyo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252713018,"owners_count":21792410,"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":["ango-dev-fest-2020","hacktoberfest"],"created_at":"2024-08-02T23:00:36.487Z","updated_at":"2025-05-06T15:32:18.984Z","avatar_url":"https://github.com/AlexJuca.png","language":"Java","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"#\" target=\"_blank\"\u003e\n        \u003cimg src=\"logo/kiyo.png\" width=\"64\" alt=\"Kiyo Permissions Library\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\n\n[![](https://jitpack.io/v/AlexJuca/Kiyo.svg)](https://jitpack.io/#AlexJuca/Kiyo)\n\nKiyo is a simple to use and light-weight android permissions Library for Android M (API 23) and above.\n\nDownload\n--------\n\nDownload the latest version via Gradle:\n\n**Step 1:** Include jitpack to your projects build.gradle file\n```\nallprojects {\n    repositories {\n\t...\n\tmaven { url 'https://jitpack.io' }\n    }\n}\n```\n\n**Step 2:** Add the Kiyo dependency to your build.gradle file\n\n```\ndependencies\n{\n\timplementation 'com.github.AlexJuca:Kiyo:0.0.2'\n}\n```\n\n\nHow to use\n----------\n\n**Step 1:** Set up a KiyoListener to handle callbacks. \n```java\n\nprivate KiyoListener kiyoListener = new KiyoListener() {\n        @Override\n        public void onPermissionAccepted(int response) {\n            call();\n        }\n\n        @Override\n        public void onPermissionDenied(int response) {\n\n        }\n\n        @Override\n        public void onShouldShowRequestPermissionRationale() {\n\n        }\n    };\n```\n\n**Step 2:** Set up Kiyo and define the permission that you need using the ```withPermission()``` method. Also pass in the KiyoListener that you defined to the ```withListener()``` method. Then call ```verify()``` to start the verification process. \n\n```java\n    Kiyo.with(this).withPermission(Manifest.permission.CALL_PHONE).withListener(kiyoListener).verify();\n```\n\n**Step 3:** Implement the ```onRequestPermissionsResult()``` method in your Activity and in it's body call ```Kiyo.with(this).withListener(kiyoListener).onRequestPermissionsResult(requestCode, permissions, grantResults);``` passing in the same arguments.\n\n\n```java\n    @Override\n    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n        super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n        Kiyo.with(this).withListener(kiyoListener).onRequestPermissionsResult(requestCode, permissions, grantResults);\n    }\n```\n\n\nMore context\n----------\n\n```java\npublic class MainActivity extends AppCompatActivity {\n    private KiyoListener kiyoListener = new KiyoListener() {\n        @Override\n        public void onPermissionAccepted(int response) {\n            call();\n        }\n\n        @Override\n        public void onPermissionDenied(int response) {\n\n        }\n\n        @Override\n        public void onShouldShowRequestPermissionRationale() {\n\n        }\n    };\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        final Button call = findViewById(R.id.button);\n        call.setOnClickListener(new View.OnClickListener() {\n            @Override\n            public void onClick(View v) {\n                call();\n            }\n        });\n\n        Kiyo.with(this).withPermission(Manifest.permission.CALL_PHONE).withListener(kiyoListener).verify();\n    }\n\n    @SuppressLint(\"MissingPermission\")\n    public void call() {\n        Intent call = new Intent(Intent.ACTION_CALL, Uri.parse(\"tel: 994590923\" + Uri.encode(\"#\")));\n        startActivity(call);\n    }\n\n    @Override\n    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {\n        super.onRequestPermissionsResult(requestCode, permissions, grantResults);\n        Kiyo.with(this).withListener(kiyoListener).onRequestPermissionsResult(requestCode, permissions, grantResults);\n    }\n}\n```\n\n\n## Version history\n``` 0.0.1: check for single permission - 24/03/2019 ``` \u003cbr/\u003e\n``` 0.0.2: Fix compile issues in libraries using APIs lower than 23. - 26/03/2019 ``` \u003cbr/\u003e\n\nLicense\n--------\n\n    Copyright Alexandre Antonio Juca \u003ccorextechnologies@gmail.com\u003e\n\n    Licensed under the Apache License, Version 2.0 (the \"License\");\n    you may not use this file except in compliance with the License.\n    You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n    Unless required by applicable law or agreed to in writing, software\n    distributed under the License is distributed on an \"AS IS\" BASIS,\n    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n    See the License for the specific language governing permissions and\n    limitations under the License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexJuca%2FKiyo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FAlexJuca%2FKiyo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FAlexJuca%2FKiyo/lists"}