از Google Drive Android API مهاجرت کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
Drive Android API از 6 دسامبر 2018 منسوخ شده است و در 1 فوریه 2023 به طور کامل رد خواهد شد .
جدول زمانی
تاریخ | وضعیت Android API را درایو کنید |
---|
6 دسامبر 2018 | منسوخ شدن به صورت عمومی اعلام می شود. کلاینت های موجود می توانند به طور معمول به API دسترسی داشته باشند، اما باید بلافاصله با تلاش های مهاجرت شروع شود. مشتریان جدید نباید از API استفاده کنند. |
21 اکتبر 2019 | Drive Android API از توزیع SDK خدمات Google Play حذف شده است. تا زمانی که وابستگی Drive Android API حذف نشود، برنامهها نمیتوانند ساخته شوند، اما ساختهای موجود تحت تأثیر قرار نخواهند گرفت. اسناد عمومی Drive Android API دیگر در دسترس نخواهد بود. |
3 مارس 2022 | Drive Android API منسوخ شده است و همه تماسهای API غیرعملیاتی هستند. مشتریان باید تا این تاریخ مهاجرت کنند. |
1 فوریه 2023 | Drive Android API به طور کامل خاموش خواهد شد و همه تلاشها برای اتصال ناموفق خواهند بود. |
از Drive REST API استفاده کنید
Drive REST API عملکردی مشابه با Drive Android API ارائه میکند، از جمله راههایی برای:
برای تسهیل تلاشهای مهاجرت مشتری، یک برنامه نمونه ارائه شده است که هر یک از جایگزینهای پیشنهادی در بالا را نشان میدهد. همچنین نحوه ایجاد، تغییر و پرس و جو برای فایلهای Drive کاربر با استفاده از REST API را نشان میدهد. اگر مشکلی دارید، تگ google-drive-api را در StackOverflow بررسی کنید.
مهاجرت
از آنجایی که Drive Android API منسوخ شده است و همه تماسهای API غیرعملیاتی هستند، مطمئن شوید که برنامه شما دیگر با API تماس نمیگیرد. برای انجام این کار، کدی که API را مقداردهی اولیه می کند حذف کنید: addApi(Drive.API)
.
اگر از Drive Android API مهاجرت نکنید و برنامه شما سعی کند با API تماس بگیرد، پیام خطای زیر برگردانده میشود:
com.google.android.gms.common.api.ApiException: 17: API: Drive.API is not available on this device. Connection failed with: ConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-04 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-04 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Migrate from the Google Drive Android API\n\n**The Drive Android API is deprecated as of December 6, 2018 and will be fully\nturned down on February 1, 2023**.\n\nTimeline\n--------\n\n| Date | Drive Android API status |\n|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| December 6, 2018 | Deprecation is [publicly announced](https://cloud.google.com/blog/products/application-development/sync-google-drive-files-to-apps-using-the-drive-rest-api-bidding-farewell-to-the-drive-android-api). Existing clients will be able to access the API normally, but should immediately commence with migration efforts. New clients must not use the API. |\n| October 21, 2019 | The Drive Android API is removed from the Google Play Services SDK distribution. Apps will be unable to build until removing the Drive Android API dependency, but existing builds will be unaffected. The Drive Android API public documentation will no longer be available. |\n| March 3, 2022 | The Drive Android API is deprecated and all API calls are non-operational. Clients must migrate by this date. |\n| February 1, 2023 | The Drive Android API will be fully turned down and all connection attempts will be unsuccessful. |\n\nUse the Drive REST API\n----------------------\n\nThe Drive REST API offers the same functionality as the Drive Android API,\nincluding ways to:\n\n- Share and collaborate as you expect from Drive. You can [manage permissions or prompt the Share dialog](/workspace/drive/api/guides/manage-sharing) to users as needed. The REST API also allows for commenting on files, allowing your app to interact with the conversation around a file.\n- Search for files using [`files.list`](/workspace/drive/api/v3/reference/files/list), based on traditional indexing or [your own customized, indexable text](/workspace/drive/api/guides/file).\n- Detect changes to files through the [Changes collection](/workspace/drive/api/v3/reference/changes) and to any shared with the user through [shared drives](/workspace/drive/api/guides/enable-shareddrives).\n- Export and convert Google Docs so that your app can easily [open a user's document](/workspace/drive/api/guides/integrate-open#specific).\n\nTo ease client migration efforts, a\n[sample app](https://github.com/googleworkspace/android-samples/tree/master/drive/deprecation) is provided which\ndemonstrates each of the proposed replacements above. It also shows how to\ncreate, modify, and query for a user's Drive files using the REST API. If you\nhave any issues, check out the\n[google-drive-api](https://stackoverflow.com/questions/tagged/google-drive-api?tab=Newest)\ntag on StackOverflow.\n\nMigration\n---------\n\nSince the Drive Android API is deprecated, and all API calls are\nnon-operational, make sure your app is no longer calling the API. To do this,\nremove the code that initializes the API: `addApi(Drive.API)`.\n\nIf you don't migrate from the Drive Android API, and your app attempts to call\nthe API, the following error message is returned:\n\n`com.google.android.gms.common.api.ApiException: 17: API: Drive.API is not\navailable on this device. Connection failed with:\nConnectionResult{statusCode=API_UNAVAILABLE, resolution=null, message=null}`"]]