{"id":24912370,"url":"https://github.com/nishith4545/photopicker","last_synced_at":"2026-05-02T09:32:25.336Z","repository":{"id":273047847,"uuid":"918540345","full_name":"Nishith4545/photopicker","owner":"Nishith4545","description":"Photopicker Library","archived":false,"fork":false,"pushed_at":"2025-03-01T07:21:54.000Z","size":1461,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T04:18:42.179Z","etag":null,"topics":["android","android-app","android-library","android-studio","google","imagepicker","kotlin","kotlin-android","videopicker"],"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/Nishith4545.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":"2025-01-18T07:31:51.000Z","updated_at":"2025-03-01T07:19:08.000Z","dependencies_parsed_at":"2025-01-18T09:31:57.607Z","dependency_job_id":"a8b50c12-f2ce-4a65-afc4-aa3479f9fa97","html_url":"https://github.com/Nishith4545/photopicker","commit_stats":null,"previous_names":["nishith4545/photopicker"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nishith4545%2Fphotopicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nishith4545%2Fphotopicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nishith4545%2Fphotopicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Nishith4545%2Fphotopicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Nishith4545","download_url":"https://codeload.github.com/Nishith4545/photopicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245966927,"owners_count":20701758,"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":["android","android-app","android-library","android-studio","google","imagepicker","kotlin","kotlin-android","videopicker"],"created_at":"2025-02-02T05:19:24.930Z","updated_at":"2026-05-02T09:32:25.163Z","avatar_url":"https://github.com/Nishith4545.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PhotoPicker Android Kotlin Library\n\n\u003cimg src=\"image_2024_11_28T10_44_04_760Z.png\" alt=\"MediaPicker Screenshot\" width=\"250\"/\u003e\n\nThis is a simple Android Kotlin library to integrate the new Android Photo Picker in your app, in compliance with Google's new policy regarding the use of photo and video permissions. The library allows you to easily access photos and videos while adhering to privacy guidelines.\n\n## Library Version\n\n- Version: 1.0.0\n\n## Implementation\n\nAdd the following dependency in your `build.gradle` file to use the library:\n\n```gradle\n   dependencies {\n       //use latest version\n       implementation 'com.github.Nishith4545:photopicker:1.0.0'\n   }\n```\n### Overview\n\nThe **PhotoPicker Library** is designed for apps that have a one-time or infrequent need to access photos and videos. The library uses the system picker (Android Photo Picker) and is compliant with Google's latest policy updates.\n\nThis library is ideal for scenarios like:\n- Allowing users to select one or few images/videos at a time.\n- No persistent or frequent access to media files is required.\n\n### Features\n\n- Complies with Android's Photo Picker and the new Play Store policy.\n- Simple integration with minimal permissions.\n- Supports both image and video selection.\n- Compatible with lower Android versions as well.\n                                                      \n## Usage\n\n### Step 1: Initialize the MediaSelectHelper\nIn your Fragment or Activity's onCreate method, initialize the MediaSelectHelper instance.\n\n```koltin\nlateinit var mediaSelectHelper: MediaSelectHelper\n\noverride fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_main)\n    \n    mediaSelectHelper = MediaSelectHelper(this)\n}\n```\n### Step 2: Launch the Picker\nYou can launch the photo picker for images or videos. The following examples show how to configure the picker for single or multiple selections.\n\nFor Images:\nTo pick a single image, use the following code:\n```kotlin\nmediaSelectHelper.canSelectMultipleImages(false)\nmediaSelectHelper.selectOptionsForImagePicker(true)\n```\nFor Videos:\nTo pick a single video, use the following code:\n```kotlin\nmediaSelectHelper.canSelectMultipleVideo(false)\nmediaSelectHelper.selectOptionsForVideoPicker()\n```\n### Step 3: Set up the Media Selection Callback\nTo handle the media selection result, register the callback using the `MediaSelector` interface. The callback functions will provide the selected media URIs, including image and video.\n\n```kotlin\nprivate fun setImagePicker() = with(binding) {\n    mediaSelectHelper.registerCallback(object : MediaSelector {\n        override fun onVideoUri(uri: Uri) {\n            super.onVideoUri(uri)\n            getPath(this@MainActivity, uri)?.let { path -\u003e\n                playerView.show()\n                imageView.hide()\n                setUpVideoUrl(uri)\n            }\n        }\n\n        override fun onImageUri(uri: Uri) {\n            playerView.hide()\n            imageView.show()\n            uri.path?.let {\n                imageView.loadImagefromServerAny(it)\n            }\n        }\n\n        override fun onCameraVideoUri(uri: Uri) {\n            playerView.show()\n            imageView.hide()\n            setUpVideoUrl(uri)\n        }\n\n        override fun onImageUriList(uriArrayList: ArrayList\u003cUri\u003e) {\n            super.onImageUriList(uriArrayList)\n        }\n\n        override fun onVideoURIList(uriArrayList: ArrayList\u003cUri\u003e) {\n            super.onVideoURIList(uriArrayList)\n        }\n    }, supportFragmentManager)\n}\n```\n\n### Compatibility\nThis library is compatible with backward and lower versions of Android, allowing you to use the new Photo Picker on all supported devices.\n\n### Permissions\nThe library helps you comply with the Play Photo and Video Permissions policy. It requests access to photos and videos using the system picker, eliminating the need for READ_MEDIA_IMAGES and READ_MEDIA_VIDEOS permissions. Ensure that your app is in compliance with the new policy guidelines to avoid enforcement actions.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishith4545%2Fphotopicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnishith4545%2Fphotopicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnishith4545%2Fphotopicker/lists"}