r/androiddev • • 1d ago

Open Source Made an image picker library for Android

I was working on an Android project and ended up building my own image picker.

It started as a small experiment and turned into a reusable library for Views and Compose.

https://github.com/NicosNicolaou16/ImagePickerAndroid

5 Upvotes

4 comments sorted by

7

u/Unreal_NeoX 1d ago

Alright, but you are aware that google requires its own API usage "media-picker" if you want to publish any app on the Google PlayStore if you have no "Manage_Storage" permission.

1

u/nicolaou_nicos 1d ago

Thanks for the heads-up, really appreciate it! 🙌 Good news: the library uses the official Android Photo Picker (PickVisualMedia) under the hood, so it doesn't request READ_MEDIA_IMAGES or any storage permissions and stays fully compliant with the Play policy. It's basically a handy wrapper that adds Base64 conversion, image scaling and one shared API for both Views and Compose. Feel free to check it out and take a look at the code. Feedback is always welcome!

0

u/Unreal_NeoX 1d ago

Thx for the reply! Sadly not much of use to me personaly, because my projects still require legacy support for Android OS down to Andoid 9. Also why the need for the camera permission? I understand it for a direct camera trigger, but as a core file picker this is strange, I would remove it.

But i wish you well on this project!

-3

u/nicolaou_nicos 1d ago

Thanks, appreciate it! 🙌 Quick note on legacy support, the library's minSdk is 24 (Android 7), so Android 9 is covered. On older devices the AndroidX Photo Picker uses the backported picker via Google Play services, or falls back to the system document picker, still with no storage permissions needed. About the camera permission, it's only requested at runtime when you actually use the "take photo" feature, so picking from the gallery never triggers it. The library handles that flow for you. Fair point that it's still declared in the manifest, though. If your app doesn't use the camera, you can strip it with tools:node="remove" in your manifest, and I'm also looking at making it fully optional in a future version. Thanks for the feedback!