ย้ายข้อมูลจาก Google ไดรฟ์สำหรับ Android API
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เราเลิกใช้งาน Drive Android API ตั้งแต่วันที่ 6 ธันวาคม 2018 และจะปิดตัวอย่างสมบูรณ์ในวันที่ 1 กุมภาพันธ์ 2023
ไทม์ไลน์
วันที่ |
สถานะ API ของไดรฟ์สำหรับ Android |
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 โดยสมบูรณ์ และการพยายามเชื่อมต่อทั้งหมดจะไม่สำเร็จ
|
ใช้ REST API ของไดรฟ์
REST API ของไดรฟ์มีฟังก์ชันการทำงานเหมือนกับ Android API ของไดรฟ์
ซึ่งรวมถึงวิธีทำสิ่งต่อไปนี้
เรามีแอปตัวอย่างเพื่อช่วยให้การย้ายข้อมูลไคลเอ็นต์เป็นไปได้ง่ายขึ้น ซึ่งจะแสดงให้เห็นถึงการแทนที่แต่ละรายการที่เสนอข้างต้น นอกจากนี้ ยังแสดงวิธี
สร้าง แก้ไข และค้นหาไฟล์ในไดรฟ์ของผู้ใช้โดยใช้ 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}
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-04 UTC
[null,null,["อัปเดตล่าสุด 2025-08-04 UTC"],[],[],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}`"]]