Android google drive api创建和编辑excel文件

时间:2014-08-20 07:20:15

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

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

application/vnd.openxmlformats-officedocument.spreadsheetml.sheet

作为MIME类型,我可以在Drive上看到该文件,在编辑它时,Drive会将其复制并转换为自己的类型作为新文件。因此,当我使用我的应用程序返回此文件时,该文件仍为空。

如果我使用:

application/vnd.google-apps.spreadsheet  

作为MIME类型,Google云端硬盘响应它已成功创建该文件,但我无法在云端硬盘上看到它。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

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

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