簡體   English   中英

如何從Android應用程序共享Google Drive文件?

[英]How to share Google Drive file from Android app?

我的Android應用使用新的Google雲端硬盤API在Google雲端硬盤上創建文件。 我成功獲得了DriveFile對象。

問題是: 如何從我的應用程序共享此文件? 歡迎鏈接到相關主題,特別是代碼示例。

特定於Android的API尚不支持共享。 您可以使用RESTful Web API執行此操作。 查看權限

在DriveId中,您可以獲取resourceId,這是您訪問Web API中的文件所需的ID。

Permission newPermission = new Permission();
newPermission.setValue(emailvalue);
newPermission.setType(type);
newPermission.setRole(role);
try {
   service.permissions().insert(fid, newPermission).execute();
   showToast("Done Shared successfully!!!!!!");
} catch (IOException e) {
  System.out.println("An error occurred: " + e);
}

暫無
暫無

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

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