![](/img/trans.png)
[英]Google Drive Implementation to Android app and Downloading the file from 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.