【问题标题】:Get FusionTable tableId knowing the name in Java Android API获取 FusionTable tableId 知道 Java Android API 中的名称
【发布时间】:2013-09-23 18:27:16
【问题描述】:

我正在尝试获取 fusion-table 的内容,知道表的名称。 我在 Android 代码中使用 Java Google API 库。 其实我用这个代码:

String table_name = "table";
TableList tablelist = client.table().list().execute();
if (tablelist.getItems()!=null){
   for (Table table : tablelist.getItems()) {
           if (table.getName().equals(table_name)){
         `     String fusionId = table.getTableId();
           }
       }
}

因为它本身是一个圆圈,在我看来它很重......我更喜欢使用知道名称的“行脚本”来获取 TableId。

有什么办法吗?

【问题讨论】:

  • 如果您不知道 - 您可以从 fusion table web 界面获取任何 table 的 ID。只需查看文件菜单 --> '关于此表'。

标签: java android optimization google-api google-fusion-tables


【解决方案1】:

您可以使用 Google Drive API 按名称定位 Fusion Table

调用文件:q=title 的列表包含 'table_name' 和 mimeType = 'application/vnd.google-apps.fusiontable'

这将返回一个文件列表,其中包含您的表的文件描述符(如果存在具有该名称的文件描述符)。文件id也是表id。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-04-03
    • 1970-01-01
    • 1970-01-01
    • 2018-10-28
    • 1970-01-01
    • 2020-11-26
    • 2011-02-08
    • 1970-01-01
    相关资源
    最近更新 更多