簡體   English   中英

Android使用Google Play服務將文本文件從sdcard上傳/下載到Google雲端硬盤

[英]Android upload/download text files from sdcard to Google Drive with Google Play Services

我想使用Google Play服務在我的Android應用中實現Google Drive的上傳/下載txt文件,但是我找不到正確的方法。

在保管箱中非常簡單:

File file = new File("working-draft.txt");
FileInputStream inputStream = new FileInputStream(file);
Entry response = mDBApi.putFile("/magnum-opus.txt", inputStream,
                            file.length(), null, null);
Log.i("DbExampleLog", "The uploaded file's rev is: " + response.rev);

但是對於帶有Google Play服務的Google雲端硬盤,我還沒有找到一種簡單的方法。 你知道怎么?

順便說一句,我想使用自己的憑據(Google服務帳戶)而不是用戶帳戶,通過Google Play服務實現該身份的方式是什么?

提前致謝

在這里看看 ,它可以完成您提到的所有內容。 我不知道“簡單”的要求。 在此處查看官方的DEMO代碼 但這絕對不是“兩線”的努力。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM