【问题标题】:Android google drive api create and edit excel fileAndroid google drive api 创建和编辑excel文件
【发布时间】:2014-08-20 07:20:15
【问题描述】:

我正在尝试创建一个新的 Excel 文件并在 Android 应用程序中对其进行编辑。我正在使用 Google Drive android API。如果我使用:

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

作为 MIME 类型,我可以在云端硬盘上看到该文件,并且在编辑它时,云端硬盘会复制并将其转换为自己的类型作为新文件。所以当我用我的应用程序取回这个文件时,文件仍然是空的。

如果我使用:

application/vnd.google-apps.spreadsheet  

作为 MIME 类型,Google Drive 响应它已成功创建文件,但我在 Drive 上看不到它。

有什么想法吗?

【问题讨论】:

    标签: android excel google-drive-api mime-types google-drive-android-api


    【解决方案1】:

    application/vnd.google-apps.spreadsheet 是 Google 电子表格的 MIME 类型,而不是 Excel 文件。您目前无法通过 Android API 创建 Google 电子表格(它返回成功是一个错误。)

    如果要创建 Microsoft excel 文档,则需要 excel MIME 类型:application/vnd.ms-excel

    【讨论】:

    • 我想在驱动器上创建一个文件,用户可以在谷歌驱动器上编辑它,然后我想从应用程序中读取它。该文件可以是电子表格文件或 Excel 文件。 Excel mime 类型可以,但是当想在驱动器上编辑它时,驱动器将其转换为电子表格文件。所以当我阅读我的文件时它仍然是空的
    • 我认为您现在无法通过 Android API 执行此操作。您可以使用 REST API 从例如 csv 导入/导出到 Google 电子表格。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-06
    相关资源
    最近更新 更多