Google udostępnia na GitHubie te przykłady: Możesz stworzyć kopie tych repozytoriów i używać kodu jako odniesienia w swoich własnych projektach.
Google Picker
Przykładowy kod selektora Google pokazuje, jak użyć selektora obrazów lub strony przesyłania, którą użytkownicy mogą otworzyć z poziomu przycisku w aplikacji internetowej.
Aby wyświetlić lub pobrać źródło, otwórz Google Picker w repozytorium GitHub.
Otwieranie i zapisywanie plików w Quickeditors
Ten przykładowy kod Quickeditors pokazuje, jak otwierać i zapisywać pliki za pomocą interfejsu Drive API.
Każdy przykład dotyczący platformy Dysku dotyczy jednej aplikacji: edytora tekstu o nazwie Quickeditor, który umożliwia edytowanie plików Dysku o typie MIME text/*. Wersja internetowa obsługuje 2 podstawowe przypadki użycia Dysku:
Przebieg obu tych procesów jest podobny. Dysk przekierowuje użytkownika do aplikacji po wybraniu jej z menu tworzenia lub menu kontekstowego pliku z zarejestrowanym typem MIME.
Aby wyświetlić lub pobrać źródło, otwórz Quickeditors na repozytorium GitHub.
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-02-24 UTC."],[[["This section provides Google Drive API samples, including code for integrating Google Picker and Quickeditors into web applications."],["The Google Picker sample demonstrates how to implement an image selector or upload page within a web app."],["Quickeditors samples showcase opening and saving files with the Drive API, including integration with Drive UI's \"New\" and \"Open with\" functionalities."],["Source code for both Google Picker and Quickeditors is available on GitHub for reference and adaptation in your projects."]]],["Google offers code samples on GitHub for the Drive API. The Google Picker sample demonstrates using an image selector or upload page within a web app, accessible via a button. The Quickeditors sample illustrates how to open and save files, integrating with Drive's \"New\" button and \"Open with\" context menu. Both samples provide text editor apps for files with the `text/*` MIME type. Source code is available on GitHub, which can be forked.\n"]]