דוגמאות ל-API של Google Drive
בקטע הזה מפורטות דוגמאות ל-Google Drive API.
ב ספריית הסרטונים של Drive API תוכלו למצוא סרטונים מבוא בנושא Drive API.
Google מארחת את הדוגמאות הבאות ב-GitHub. אפשר ליצור ענף (fork) של המאגרים האלה ולהשתמש בקוד כמקור מידע לפרויקטים שלכם.
Google Picker
דוגמת הקוד של Google Picker מראה איך להשתמש בבורר תמונות או בדף העלאה שהמשתמשים יכולים לפתוח מכפתור באפליקציית אינטרנט.
כדי להציג או להוריד את המקור, אפשר להיכנס לדף Google Picker במאגר GitHub.
פתיחה ושמירה של קבצים באמצעות Quickeditors
דוגמת הקוד הזו של Quickeditors מראה איך לפתוח ולשמור קבצים באמצעות Drive API.
כל אחת מהדוגמאות הספציפיות לפלטפורמת Drive משקפת אפליקציה לדוגמה אחת: כלי לעריכת טקסט שנקרא Quickeditor, שיכול לערוך קובצי Drive עם סוג ה-MIME text/*
. בגרסת האינטרנט יש שני תרחישים לדוגמה לשימוש ב-Drive:
התהליך בשני תרחישים לדוגמה דומה. Drive מפנה את המשתמש לאפליקציה אחרי שהוא בוחר אותה מתפריט היצירה או מתפריט ההקשר של קובץ עם סוג MIME רשום.
כדי להציג או להוריד את המקור, אפשר להיכנס לדף Drive Quickeditors במאגר GitHub.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-02-24 (שעון UTC).
[null,null,["עדכון אחרון: 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"]]