Monday, November 25, 2024

Android 16 will make the Photo Picker feel more integrated in apps

Must read

Your photos and videos are sensitive files that you probably dont want apps to access without your consent. Unfortunately, many apps refuse to provide certain features if you dont grant them access to your phones entire media gallery, even if they only need access to a single file. To solve this problem, Google created the photo picker, a privacy-preserving way for apps to get temporary access to media files. Many apps dont support the photo picker, though fortunately, Google is giving them one less reason to overlook it in Android 16.

Google introduced the photo picker as one of several new privacy-related improvements in Android 13. Rather than ask for access to your phones entire media gallery, apps can use the photo picker to ask you to grant them access to selected images and videos stored locally or on Google Photos. The photo picker is designed for apps that have a one-time or infrequent need to access some photos or videos, such as apps that ask you to upload a photo to use as your avatar. It functionally accomplishes the same thing as the system file picker that Google introduced way back in Android 4.4 but does so with a UI thats better suited for images and videos.

Even so, the photo picker has had poor adoption among app developers. Developers had good reasons not to migrate over to the new picker, though, as Google released it in a half-baked state. While Google finally fixed the photo pickers biggest flaw earlier this year by rolling out support for cloud media providers, it has yet to fix other major annoyances, such as a lack of search support. The photo picker also just feels less integrated than the custom photo pickers that many developers created themselves, making it harder for them to justify the transition. This last issue is something that Google has a solution for in Android 16, thankfully.

Android_Photo_Picker_photos_tab

With the release of Android 16 Developer Preview 1 earlier today, developers finally have a way to embed the photo picker into their apps. Google says that Android 16 includes new APIs that enable apps to embed the photo picker into their view hierarchy, which allows it to feel like a more integrated part of the app while still leveraging the process isolation that allows users to select media without the app needing overly-broad permissions.

How the new embedded photo picker might work

We dont have a lot of details about how the new embedded photo picker will work, but Androids source code suggests the embedded picker can respond to configuration changes like the screen orientation or theme changing, can hide the overflow menu and preview features, includes the selection bar and snack bar, and can be expanded or collapsed.

To take advantage of this new embedded photo picker, Google recommends developers wait for a forthcoming Jetpack library thatll simplify how its accessed on not just Android 16 but also older releases. This is because while the new APIs are available by default on devices running Android 16, they need to be backported to devices running Android 11 through Android 15 with a Google Play System Update as well as to devices running Android 4.4 through Android 10 with an update to Google Play Services.

Androids new embedded photo picker experience is a win-win for both users and developers. It makes the photo picker feel more like a native part of your favorite Android apps, which in turn will convince more developers to use it. When Google Play started cracking down on apps that unnecessarily access your media library, forcing them to migrate to either the system file picker or the photo picker, some developers complained about the move as they saw Androids photo picker as a downgrade from their custom pickers. By adding new features like this, though, Google is giving developers more reasons to migrate to Androids photo picker, improving privacy and making the photo picking experience more unified across apps.

Latest article