What permissions and for what API versions are required for PhotoPicker?

What permissions and for what API versions are required to request a photo/video from the gallery using PhotoPicker with

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>registerForActivityResult(
ActivityResultContracts.PickMultipleVisualMedia())
</code>
<code>registerForActivityResult( ActivityResultContracts.PickMultipleVisualMedia()) </code>
registerForActivityResult(
ActivityResultContracts.PickMultipleVisualMedia())

?

The application supports Android 8 (API 26). If I understand correctly, Android 14 does not require permissions? But in other versions? I did not find any clear explanations about this in the documentation.

Yes, starting with Android 14 (API level 34), media selection (images, videos, etc.) no longer requires any permissions, as Android 14 has significantly streamlined access to media files.

Key Points for Media Access in Android 14 (API level 34):

  • No permissions required for media access:

    • Users can access media files (images, videos, etc.) without needing to request specific permissions such as READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, or READ_MEDIA_AUDIO.
  • PhotoPicker API:

    • Available natively for single media selection and no permissions are required.
  • PickMultipleVisualMedia API:

    • Also available for multiple media selection, and again, no permissions are required for accessing media.
  • Scoped Storage is enforced:

    • Even though no explicit permissions are required, the scoped storage model still applies, meaning apps are limited to accessing only the media that the user selects, either via PhotoPicker or PickMultipleVisualMedia, and not the entire storage.
  1. Android 9 (API 28) and Below:

    • Permissions: READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE.
    • Key Notes: Full external storage access without restrictions. No Scoped Storage model, meaning apps can access all files without limitations.
  2. Android 10 (API 29):

    • Permissions: READ_EXTERNAL_STORAGE, Scoped Storage.
    • Key Notes: Scoped Storage introduced. Apps are restricted to access only their own private storage or shared media (via MediaStore). No PhotoPicker API.
  3. Android 11 (API 30):

    • Permissions: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO.
    • Key Notes: Scoped Storage enforced with granular permissions for different types of media. The PhotoPicker API is introduced, allowing users to select images and videos more easily. Apps need to request specific media permissions for images, videos, and audio.
  4. Android 12 (API 31):

    • Permissions: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO.
    • Key Notes: Granular media permissions continue. Scoped Storage is fully enforced, restricting file access further. Apps must request specific permissions for media access (e.g., images, videos). The PhotoPicker API remains available.
  5. Android 13 (API 33):

    • Permissions: READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO.
    • Key Notes: Granular permissions remain in place. The PickMultipleVisualMedia API is introduced, allowing users to select multiple images or videos at once.
  6. Android 14 (API 34):

    • Permissions: No permissions required for media access.
    • Key Notes: No permissions are needed for accessing media like images, videos, or audio. The PhotoPicker API continues with improvements to allow easier media selection. Further optimizations and user privacy features added.

These key notes outline the evolution of Scoped Storage, permissions for accessing media, and the introduction of PhotoPicker and PickMultipleVisualMedia across different Android versions.

And,

Key Points for PhotoPicker API and PickMultipleVisualMedia API Availability:

1. Android 13 (API level 33) and above:

  • PickMultipleVisualMedia API is natively available:
    • Allows users to select multiple images or videos in a single picker interface.
    • The first native API to support multiple media selection directly.
    • Available alongside the PhotoPicker API.
  • PhotoPicker API is natively available:
    • Allows users to select single images or videos.
    • Introduces granular permissions for media access (READ_MEDIA_IMAGES, READ_MEDIA_VIDEO, READ_MEDIA_AUDIO).

2. Android 12 (API level 31):

  • PickMultipleVisualMedia API is not available:
    • Android 12 supports only single media selection via the PhotoPicker API (for selecting one image or video at a time).
  • PhotoPicker API is natively available:
    • Allows single media selection.
    • Granular media permissions introduced for more control over which types of media are accessible.

3. Android 11 (API level 30):

  • PickMultipleVisualMedia API is not available:
    • Only the PhotoPicker API is available for single media selection.
  • PhotoPicker API is natively available:
    • Allows single media selection.
    • Introduces granular permissions for images, videos, and audio.

4. Android 10 (API level 29) and below:

  • Neither the PickMultipleVisualMedia API nor the PhotoPicker API is natively available:
    • You can use Storage Access Framework (SAF) or MediaStore API for file access.
    • Multi-selection is not natively supported, and a custom solution must be implemented for selecting multiple media items.

5. Backporting for Android 4.4 to 10 (API 19-29) and Android Go Devices (with Android 11/12):

  • PhotoPicker API can be backported via Google Play services for single media selection on devices running Android 4.4 to Android 10 and Android Go devices running Android 11/12.
    • This backporting is achieved by adding a metadata entry in the app’s manifest file.
    • Only single media selection is possible when using the backported PhotoPicker API.
  • The PickMultipleVisualMedia API cannot be backported to versions below Android 13 (API 33).

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật