{"id":20881446,"url":"https://github.com/js-bhavyansh/permissions_handling","last_synced_at":"2026-05-14T23:05:27.855Z","repository":{"id":248620649,"uuid":"829207740","full_name":"js-bhavyansh/Permissions_Handling","owner":"js-bhavyansh","description":"A Jetpack Compose Android app to request and handle camera and microphone permissions.","archived":false,"fork":false,"pushed_at":"2024-07-16T02:25:52.000Z","size":108,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-12T17:15:35.433Z","etag":null,"topics":["android","camera","compose-ui","jetpack-compose","kotlin","kotlin-android","microphone","permissions-android","viewmodel"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/js-bhavyansh.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":"2024-07-16T01:28:15.000Z","updated_at":"2024-07-16T02:25:55.000Z","dependencies_parsed_at":"2024-07-16T05:54:45.720Z","dependency_job_id":null,"html_url":"https://github.com/js-bhavyansh/Permissions_Handling","commit_stats":null,"previous_names":["bhavyansh03-tech/permissions_handling","js-bhavyansh/permissions_handling"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/js-bhavyansh/Permissions_Handling","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FPermissions_Handling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FPermissions_Handling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FPermissions_Handling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FPermissions_Handling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/js-bhavyansh","download_url":"https://codeload.github.com/js-bhavyansh/Permissions_Handling/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/js-bhavyansh%2FPermissions_Handling/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276174844,"owners_count":25597792,"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-09-20T02:00:10.207Z","response_time":63,"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":["android","camera","compose-ui","jetpack-compose","kotlin","kotlin-android","microphone","permissions-android","viewmodel"],"created_at":"2024-11-18T07:24:55.495Z","updated_at":"2025-09-20T23:44:54.906Z","avatar_url":"https://github.com/js-bhavyansh.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Permissions Handling App\n\nThis is a sample Android app that demonstrates how to request camera and microphone permissions using Jetpack Compose.\n\n## Features\n- Requests camera and microphone permissions.\n- Shows a dialog when permissions are denied.\n- Navigates to app settings when permissions are permanently denied.\n\n## Screenshots\n\n\u003cdiv style=\"display: flex; justify-content: center; align-items: center;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/dc177a68-dc12-4000-a0ae-a4e69e48c6d9\" alt=\"First Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/d278ba6c-f707-448e-b587-aae659697858\" alt=\"Second Screenshot\" style=\"width: 200px; height: auto; margin-right: 10px;\"\u003e\n    \u003cimg src=\"https://github.com/user-attachments/assets/9466d7d5-0bbd-45cd-bdfc-6ece181e2bba\" alt=\"Third Screenshot\" style=\"width: 200px; height: auto;\"\u003e\n\u003c/div\u003e\n\n\n## Installation\n\n1. Clone the repository:\n```bash\n    git clone https://github.com/Bhavyansh03-tech/Permissions_Handling.git\n```\n2. Open the project in Android Studio.\n3. Build and run the app on your Android device or emulator.\n\n\n## Code Highlights\n\n### Asking Permission If Denied Twice\nIf the user denies the permission twice, a dialog is shown to explain why the permissions are needed.\n\n```kotlin\npermissions.forEach { permission -\u003e\n    val isGranted =\n        checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED\n\n    // If Permission is not granted :-\u003e\n    if (!isGranted) {\n        if (shouldShowRequestPermissionRationale(permission)) {\n            // If user decline permission 2 times which case should show when request permission.\n            // Directly show dialog :-\u003e\n            mainViewModel.updateShowDialog(true)\n        } else {\n            // Ask for permission :-\u003e\n            permissionsResultActivityLauncher.launch(permissions)\n        }\n    }\n}\n```\n\n## Showing a Dialog When Permissions Are Denied\n\nThe app displays a dialog to inform the user about the need for permissions and provides an option to go to the app settings if the permissions were permanently denied.\n\n```kotlin\nif (showDialog) {\n    PermissionDialog(\n        onDismiss = {\n            mainViewModel.updateShowDialog(false)\n        },\n        onConfirm = {\n            mainViewModel.updateShowDialog(false)\n\n            if (launchAppSettings){\n                // In case you want to ask permission through app settings :-\u003e\n                Intent(\n                    Settings.ACTION_APPLICATION_DETAILS_SETTINGS,\n                    Uri.fromParts(\"package\", packageName, null)\n                ).also {\n                    startActivity(it)\n                }\n                mainViewModel.updateLaunchAppSettings(false)\n            } else {\n                // In case you want to ask permission through dialog :-\u003e\n                permissionsResultActivityLauncher.launch(permissions)\n            }\n        }\n    )\n}\n```\n\n\n## Contributing\n\nContributions are welcome! Please fork the repository and submit a pull request for any improvements or bug fixes.\n\n1. Fork the repository.\n2. Create your feature branch (`git checkout -b feature/your-feature`).\n3. Commit your changes (`git commit -am 'Add some feature'`).\n4. Push to the branch (`git push origin feature/your-feature`).\n5. Create a new Pull Request.\n\n## Contact\n\nFor questions or feedback, please contact [@Bhavyansh03-tech](https://github.com/Bhavyansh03-tech).\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fpermissions_handling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjs-bhavyansh%2Fpermissions_handling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjs-bhavyansh%2Fpermissions_handling/lists"}