Chọn ảnh: những gì người dùng nhìn thấy
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Hướng dẫn này giúp bạn hiểu trải nghiệm của người dùng khi chọn các mục nội dung nghe nhìn.
Theo quy trình API bộ chọn tiêu chuẩn, chọn thực thể sau khi ứng dụng hiển thị pickerUri
và trong khi ứng dụng đang thăm dò ý kiến để mediaItemsSet
trả về giá trị true.
Để xem bất kỳ bước nào trong số này trên thiết bị của riêng bạn, hãy xem ứng dụng mẫu của chúng tôi.
Bắt đầu phiên chọn
Sau khi tạo thành công một phiên, ứng dụng của bạn sẽ hiển thị pickerUri
cho người dùng.
- Hiển thị
pickerUri
dưới dạng cả mã QR và URL.
- Cung cấp văn bản hữu ích cùng với
pickerUri
. Ví dụ: "Quét mã này để mở Google Photos và chọn các mục của bạn".
- Đối với các thiết bị có chức năng nhập hạn chế (ví dụ: ki-ốt, máy tính bảng, TV thông minh), hãy kiểm tra đề xuất của nhà sản xuất phần cứng về kích thước văn bản và chiều rộng mã QR.
Tìm và chọn ảnh
Khi người dùng truy cập vào pickerUri
, họ sẽ được đưa đến trang chọn ảnh trong ứng dụng Google Photos.
Trang này sẽ luôn hiển thị những bức ảnh gần đây nhất trong thư viện Google Photos của người dùng. Album, mục yêu thích và các danh mục ảnh phổ biến khác không được hiển thị trực tiếp. Người dùng có thể tìm kiếm ảnh bằng nhiều tiêu chí, chẳng hạn như từ khoá, ngày, vị trí và tên album.
Nếu ứng dụng của bạn sử dụng album, ngày hoặc các danh mục ảnh phổ biến khác, hãy giúp người dùng bằng cách nhắc họ tìm kiếm sau khi họ truy cập vào ứng dụng Google Photos.
Ví dụ: nếu yêu cầu người dùng chia sẻ một album cụ thể, bạn có thể đưa văn bản sau vào cùng một trang mà người dùng kết nối với Google Photos: "Kết nối với Google Photos, sau đó tìm album bạn muốn chia sẻ".
Sau khi tìm kiếm, người dùng có thể chọn một hoặc nhiều mục trong kết quả.
Màn hình Hoàn tất
Sau khi nhấn vào nút "Xong" và hoàn tất việc chọn, người dùng sẽ thấy màn hình "Xong". Thao tác này sẽ kết thúc phiên chọn và pickerUri
hiện tại sẽ không hoạt động nữa.
Để cho phép người dùng chọn thêm ảnh, hãy tạo một phiên chọn mới và hiển thị lại pickerUri
trong ứng dụng.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-29 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-08-29 UTC."],[[["\u003cp\u003eThis guide explains the user experience within the Google Photos app when selecting media items using the Picker API.\u003c/p\u003e\n"],["\u003cp\u003eUsers initiate the process by accessing the \u003ccode\u003epickerUri\u003c/code\u003e displayed in your app, which opens a photo selection page within Google Photos.\u003c/p\u003e\n"],["\u003cp\u003eUsers can search and select photos from their Google Photos library using various criteria before confirming their choices.\u003c/p\u003e\n"],["\u003cp\u003eAfter selection, users are presented with a "Done" screen, and your app can re-display the \u003ccode\u003epickerUri\u003c/code\u003e to allow for further selections in a new session.\u003c/p\u003e\n"]]],["The core process involves displaying a `pickerUri` (QR code and URL) to users, prompting them to access it. This takes them to Google Photos for photo selection. Users can search using keywords, dates, or locations to find specific photos. Upon selection and pressing \"Done,\" the process ends. Apps can offer to display the `pickerUri` again to initiate a new picking session, to select more items. While the app is polling for the media selection the process has begun.\n"],null,["# Photo picking: what users see\n\nThis guide helps you understand your user's experience when picking media items.\n\nFollowing the [standard Picker API flow](/photos/picker/guides/get-started-picker#the_picker_api_flow),\npicking beings after your app displays the [`pickerUri`](/photos/picker/reference/rest/v1/sessions#PickingSession.FIELDS.picker_uri),\nand while your app is polling for [`mediaItemsSet`](/photos/picker/reference/rest/v1/sessions#PickingSession.FIELDS.media_items_set) to return true.\n\nTo view any of these steps on your own device, check out our [sample app](/photos/picker/samples).\n\nStart the picking session\n-------------------------\n\nAfter successfully creating a session your app should display the `pickerUri` to\nyour users.\n\n- Display the `pickerUri` as both a QR code and a URL.\n- Provide helpful text alongside the `pickerUri`. For example, \"Scan this code to open Google Photos and select your items.\".\n- For devices with limited input capabilities (e.g., kiosks, tablets, smart TVs), check your hardware manufacture's recommendations on text size and QR code width.\n\nSearch and select photos\n------------------------\n\nWhen a user accesses the `pickerUri`, they are taken to a photo selection page\nwithin the Google Photos app.\n\nThis page will always display the most recent photos from your user's Google\nPhotos library. Albums, favorites, and other common photos categories are not\nshow directly. Users can search for photos using various criteria,\nsuch as keywords, dates, locations, and album titles.\n\nIf your app utilizes albums, dates, or other common photos categories, help your\nusers by prompting them to search once they enter the Google Photos app.\n\nFor example, if your asking your users to share a specific album, you could\ninclude the following text on the same page your users connect to Google Photos:\n\"Connect to Google Photos, then search for the album you want to share.\"\n\nAfter searching, the user can select one or more items from the results.\n\nDone screen\n-----------\n\nOnce the user taps the \"Done\" button and completes picking, they will see\nthe \"Done\" screen. This ends the picking session and the current `pickerUri`\nwill no longer work.\n\nTo provide your users the option to select more photos, create a new picking\nsession and display the `pickerUri` again in your app."]]