Eseguire la migrazione dall'API Google Drive per Android
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
L'API Drive per Android è stata ritirata il 6 dicembre 2018 e verrà disattivata completamente il 1° febbraio 2023.
Cronologia
Data |
Stato dell'API Drive per Android |
6 dicembre 2018 |
Il ritiro viene annunciato pubblicamente. I client esistenti potranno
accedere normalmente all'API, ma dovranno iniziare immediatamente la migrazione. I nuovi client non devono utilizzare l'API.
|
21 ottobre 2019 |
L'API Drive per Android viene rimossa dalla distribuzione dell'SDK Google Play Services. Le app non potranno essere create finché non viene rimossa la dipendenza dall'API Drive Android, ma le build esistenti non saranno interessate. La documentazione pubblica dell'API Drive Android non sarà più disponibile.
|
3 marzo 2022 |
L'API Android Drive è obsoleta e tutte le chiamate API non sono operative. I clienti devono eseguire la migrazione entro questa data.
|
1° febbraio 2023 |
L'API Drive per Android verrà completamente disattivata e tutti i tentativi di connessione non andranno a buon fine.
|
Utilizzare l'API REST Drive
L'API REST di Drive offre le stesse funzionalità dell'API Drive per Android,
inclusi i modi per:
Per facilitare gli sforzi di migrazione dei client, viene fornita un'app di esempio che mostra ciascuna delle sostituzioni proposte sopra. Mostra anche come creare, modificare ed eseguire query per i file di Drive di un utente utilizzando l'API REST. In caso di problemi, consulta il tag google-drive-api su Stack Overflow.
Migrazione
Poiché l'API Drive per Android è ritirata e tutte le chiamate API non sono
operative, assicurati che la tua app non chiami più l'API. Per farlo,
rimuovi il codice che inizializza l'API: addApi(Drive.API)
.
Se non esegui la migrazione dall'API Drive per Android e la tua app tenta di chiamare
l'API, viene restituito il seguente messaggio di errore:
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}
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-08-04 UTC.
[null,null,["Ultimo aggiornamento 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}`"]]