【问题标题】:Get spreadsheet created with Drive SDK获取使用 Drive SDK 创建的电子表格
【发布时间】:2014-01-15 17:16:50
【问题描述】:

我正在使用 Google Drive SDK 使用以下代码创建电子表格:

File body = new File();
body.setTitle(title);
body.setMimeType("application/vnd.google-apps.spreadsheet");
body.setParents(Arrays.asList(new ParentReference().setId(currentParent)));
File file = driveHelper.getDrive().files().insert(body).execute();

有没有办法使用 Google 电子表格 API 使用 Drive SDK 创建特定的电子表格? 我在不同的文件夹中有许多同名的电子表格,当我遍历所有电子表格时 我不想比较标题来获得特定的电子表格。

【问题讨论】:

    标签: java android google-drive-api google-spreadsheet-api


    【解决方案1】:

    Googles 电子表格 API 使用电子表格密钥。当您在浏览器中打开电子表格时,此 KEY 会显示在 URL 中。要查看它的使用情况,有一个简单的谷歌演示 CellDemo.java。 http://gdata-java-client.googlecode.com/svn-history/r51/trunk/java/sample/spreadsheet/cell/CellDemo.java

    我认为可以从驱动器 api 中获取所有密钥,因为您可以这样做:

    Drive driveService = new Drive.Builder(TRANSPORT, JSON_FACTORY, credential).build();
    File file = driveService.files().get(this.spreadsheetKey).execute();
    

    【讨论】:

      猜你喜欢
      • 2017-08-15
      • 1970-01-01
      • 2012-09-26
      • 1970-01-01
      • 2016-01-09
      • 1970-01-01
      • 2012-09-01
      • 2013-10-22
      • 1970-01-01
      相关资源
      最近更新 更多